fix screenos detection and add re-add graph for sessions

git-svn-id: http://www.observium.org/svn/observer/trunk@1444 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-20 14:53:55 +00:00
parent 35090598aa
commit 823b228469
4 changed files with 48 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
$device = device_by_id_cache($id);
$file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("screenos-sessions.rrd");
$rrd_list[0]['filename'] = $file;
$rrd_list[0]['descr'] = "Maxiumum";
$rrd_list[0]['rra'] = "max";
$rrd_list[1]['filename'] = $file;
$rrd_list[1]['descr'] = "Allocated";
$rrd_list[1]['rra'] = "allocate";
$rrd_list[2]['filename'] = $file;
$rrd_list[2]['descr'] = "Failed";
$rrd_list[2]['rra'] = "failed";
if ($_GET['debug']) { print_r($rrd_list); }
$colours = "mixed";
$nototal = 1;
$unit_text = "Sessions";
$scale_min = "0";
include ("generic_multi_simplex_seperated.inc.php");
?>

View File

@@ -0,0 +1,9 @@
<?php
if($device['os'] == "screenos" && is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/screenos-sessions.rrd")) {
$graph_title = "Firewall Sessions";
$graph_type = "screenos_sessions";
include ("includes/print-device-graph.php");
}
?>

View File

@@ -2,8 +2,8 @@
if(!$os) {
if(strstr($sysObjectId, "netscreen")) { $os = "screenos"; } elseif (strstr($sysObjectId, ".1.3.6.1.4.1.674.3224.1")) { $os = "screenos"; }
if (strstr($sysObjectId, ".1.3.6.1.4.1.674.3224.1")) { $os = "screenos"; }
if (strstr($sysObjectId, ".1.3.6.1.4.1.3224")) { $os = "screenos"; }
}

View File

@@ -6,9 +6,9 @@ $version = preg_replace("/(.+)\ version\ (.+)\ \(SN:\ (.+)\,\ (.+)\)/", "Juniper
echo("$version\n");
list($hardware,$version,$serial,$features) = explode("||", $version);
$cpurrd = $rrd_dir . "/" . $device['hostname'] . "/netscreen-cpu.rrd";
$memrrd = $rrd_dir . "/" . $device['hostname'] . "/netscreen-memory.rrd";
$sessrrd = $rrd_dir . "/" . $device['hostname'] . "/netscreen-sessions.rrd";
$cpurrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/screenos-cpu.rrd";
$memrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/screenos-memory.rrd";
$sessrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/screenos-sessions.rrd";
$cpu_cmd = $config['snmpget'] . " -M ".$config['mibdir'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'];
$cpu_cmd .= " .1.3.6.1.4.1.3224.16.1.1.0 .1.3.6.1.4.1.3224.16.1.3.0";
@@ -20,7 +20,6 @@ $mem_cmd .= " .1.3.6.1.4.1.3224.16.2.1.0 .1.3.6.1.4.1.3224.16.2.2.0 .1.3.6.1.4.1
$mem_data = shell_exec($mem_cmd);
list ($memalloc, $memfree, $memfrag) = explode("\n", $mem_data);
$sess_cmd = $config['snmpget'] . " -M ".$config['mibdir'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'];
$sess_cmd .= " .1.3.6.1.4.1.3224.16.3.2.0 .1.3.6.1.4.1.3224.16.3.3.0 .1.3.6.1.4.1.3224.16.3.4.0";
$sess_data = shell_exec($sess_cmd);