2009-09-25 12:18:25 +00:00
|
|
|
<?php
|
|
|
|
|
2010-02-20 17:22:22 +00:00
|
|
|
## Generate a list of ports and then call the multi_bits grapher to generate from the list
|
2009-09-25 12:18:25 +00:00
|
|
|
|
2010-05-02 19:47:09 +00:00
|
|
|
$device = device_by_id_cache($id);
|
2010-04-20 15:46:17 +00:00
|
|
|
|
2010-05-02 19:47:09 +00:00
|
|
|
$query = mysql_query("SELECT * FROM `ports` WHERE `device_id` = '".$id."'");
|
2010-04-20 15:46:17 +00:00
|
|
|
while($int = mysql_fetch_assoc($query)) {
|
|
|
|
$ignore = 0;
|
|
|
|
if(is_array($config['device_traffic_iftype'])) {
|
|
|
|
foreach($config['device_traffic_iftype'] as $iftype) {
|
|
|
|
if (preg_match($iftype ."i", $int['ifType'])) {
|
|
|
|
$ignore = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(is_array($config['device_traffic_descr'])) {
|
|
|
|
foreach($config['device_traffic_descr'] as $ifdescr) {
|
|
|
|
if (preg_match($ifdescr."i", $int['ifDescr']) || preg_match($ifdescr."i", $int['ifName']) || preg_match($ifdescr."i", $int['portName'])) {
|
|
|
|
$ignore = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-10-27 13:04:16 +00:00
|
|
|
|
2010-08-10 15:54:01 +00:00
|
|
|
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd")) && $ignore != 1) {
|
|
|
|
$rrd_filenames[] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd");
|
2009-09-25 12:18:25 +00:00
|
|
|
}
|
2010-04-20 15:46:17 +00:00
|
|
|
unset($ignore);
|
2009-09-25 12:18:25 +00:00
|
|
|
}
|
|
|
|
|
2009-10-27 13:04:16 +00:00
|
|
|
$rra_in = "INOCTETS";
|
|
|
|
$rra_out = "OUTOCTETS";
|
|
|
|
|
|
|
|
$colour_line_in = "006600";
|
|
|
|
$colour_line_out = "000099";
|
|
|
|
$colour_area_in = "CDEB8B";
|
|
|
|
$colour_area_out = "C3D9FF";
|
|
|
|
|
2010-07-24 19:14:41 +00:00
|
|
|
include ("includes/graphs/generic_multi_bits.inc.php");
|
2009-09-25 12:18:25 +00:00
|
|
|
|
|
|
|
?>
|