2009-10-28 13:52:39 +00:00
< ? php
2012-05-25 11:29:53 +00:00
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
2011-09-19 13:48:46 +00:00
$i = 0 ;
2012-05-11 13:26:14 +00:00
foreach ( dbFetchRows ( " SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id " , array ( $vars [ 'id' ])) as $port )
2011-03-17 13:35:25 +00:00
{
2011-09-19 13:48:46 +00:00
if ( is_file ( $config [ 'rrd_dir' ] . " / " . $port [ 'hostname' ] . " /port- " . safename ( $port [ 'ifIndex' ] . " .rrd " )))
2011-03-17 13:35:25 +00:00
{
2011-09-19 13:48:46 +00:00
$rrd_filename = $config [ 'rrd_dir' ] . " / " . $port [ 'hostname' ] . " /port- " . safename ( $port [ 'ifIndex' ] . " .rrd " );
2011-10-07 13:42:02 +00:00
$rrd_list [ $i ][ 'filename' ] = $rrd_filename ;
$rrd_list [ $i ][ 'descr' ] = $port [ 'hostname' ] . " - " . $port [ 'ifDescr' ];
$rrd_list [ $i ][ 'descr_in' ] = shorthost ( $port [ 'hostname' ]);
$rrd_list [ $i ][ 'descr_out' ] = makeshortif ( $port [ 'ifDescr' ]);
2011-09-19 13:48:46 +00:00
$i ++ ;
2009-10-28 13:52:39 +00:00
}
}
2011-09-19 13:48:46 +00:00
#echo($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd"));
$units = 'bps' ;
$total_units = 'B' ;
$colours_in = 'greens' ;
$multiplier = " 8 " ;
$colours_out = 'blues' ;
$nototal = 1 ;
2011-09-21 11:59:59 +00:00
$ds_in = " INOCTETS " ;
$ds_out = " OUTOCTETS " ;
2009-10-28 13:52:39 +00:00
2011-09-19 13:48:46 +00:00
include ( " includes/graphs/generic_multi_bits_separated.inc.php " );
2009-10-28 13:52:39 +00:00
2011-05-13 12:57:11 +00:00
?>