diff --git a/html/graph.php b/html/graph.php index 3dd2d5945..50a30edf5 100644 --- a/html/graph.php +++ b/html/graph.php @@ -44,7 +44,15 @@ $os = gethostosbyid($device_id); switch ($type) { - + case 'fortigate_sessions': + $graph = graph_fortigate_sessions ($hostname . "/fortigate-sessions.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical); + break; + case 'fortigate_cpu': + $graph = graph_fortigate_cpu ($hostname . "/fortigate-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical); + break; + case 'fortigate_memory': + $graph = graph_fortigate_memory ($hostname . "/fortigate-memory.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical); + break; case 'netscreen_sessions': $graph = graph_netscreen_sessions ($hostname . "/netscreen-sessions.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical); break; diff --git a/html/pages/device/dev-graphs.inc b/html/pages/device/dev-graphs.inc index f02c1b38c..c8bdafe22 100644 --- a/html/pages/device/dev-graphs.inc +++ b/html/pages/device/dev-graphs.inc @@ -8,17 +8,22 @@ while($device = mysql_fetch_array($device_query)) { echo("
"); switch ($device['os']) { - case "ScreenOS": + case "Fortigate": + echo("
Processor Utilisation
"); + $graph_type = "fortigate_cpu"; include ("includes/print-device-graph.php"); + echo("
Memory Usage
"); + $graph_type = "fortigate_memory"; include ("includes/print-device-graph.php"); + echo("
Firewall Sessions
"); + $graph_type = "fortigate_sessions"; include ("includes/print-device-graph.php"); + break; + case "ScreenOS": echo("
Processor Utilisation
"); $graph_type = "netscreen_cpu"; include ("includes/print-device-graph.php"); - echo("
Memory Usage
"); $graph_type = "netscreen_memory"; include ("includes/print-device-graph.php"); - echo("
Firewall Sessions
"); $graph_type = "netscreen_sessions"; include ("includes/print-device-graph.php"); - break; case "ProCurve": diff --git a/includes/discovery/interfaces.php b/includes/discovery/interfaces.php index d8c776752..69f2529a3 100755 --- a/includes/discovery/interfaces.php +++ b/includes/discovery/interfaces.php @@ -33,10 +33,15 @@ mysql_query("INSERT INTO `interfaces` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','$ifName')"); # Add Interface echo("+"); - } else { - # Interface Already Exists - echo("."); + } else { + mysql_query("UPDATE `interfaces` SET `deleted` = '0' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex' AND `deleted` = '1'"); + if(mysql_affected_rows()) { + echo("*"); + } else { + echo("."); + } } + $int_exists[] = "$ifIndex"; } else { # Ignored ifName echo("X"); @@ -44,6 +49,25 @@ } } + + $sql = "SELECT * FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `deleted` = '0'"; + $query = mysql_query($sql); + + while ($test_if = mysql_fetch_array($query)) { + unset($exists); + $i = 0; + while ($i < count($int_exists) && !$exists) { + $this_if = $test_if['ifIndex']; + if ($int_exists[$i] == $this_if) { $exists = 1; } + $i++; + } + if(!$exists) { + echo("-"); + mysql_query("UPDATE `interfaces` SET `deleted` = '1' WHERE interface_id = '" . $test_if['interface_id'] . "'"); + } + } + + unset($temp_exists); echo("\n"); ?> diff --git a/includes/graphing.php b/includes/graphing.php index 2b789a98c..0c2ade7a9 100644 --- a/includes/graphing.php +++ b/includes/graphing.php @@ -1,6 +1,7 @@