Add fortigate support, many thanks to Matthias Cramer (matthias dot cramer at iway dot ch)

git-svn-id: http://www.observium.org/svn/observer/trunk@2986 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-07 22:36:20 +00:00
parent 02531d8bd9
commit 87d02ab9f9
8 changed files with 5531 additions and 11 deletions

View File

@@ -1,9 +1,7 @@
<?php
## FIXME - find some fortigate hardware to test this on, and to update and generify it
$fnSysVersion = snmp_get($device, "FORTINET-MIB-280::fnSysVersion.0", "-Ovq");
$serial = snmp_get($device, "FORTINET-MIB-280::fnSysSerial.0", "-Ovq");
$fnSysVersion = snmp_get($device, "FORTINET-FORTIGATE-MIB::fgSysVersion.0", "-Ovq");
$serial = snmp_get($device, "FORTINET-FORTIGATE-MIB::fnSysSerial.0", "-Ovq");
$version = preg_replace("/(.+),(.+),(.+)/", "\\1||\\2||\\3", $fnSysVersion);
list($version,$features) = explode("||", $version);
@@ -19,8 +17,7 @@ if (isset($rewrite_fortinet_hardware[$poll_device['sysObjectID']]))
#list ($cpu, $mem, $ses, $memsize) = explode("\n", $data);
$sessrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/fortigate_sessions.rrd";
$sessions = snmp_get($device, "fnSysSesCount.0", "FORTINET-MIB-280");
$sessions = snmp_get($device, "FORTINET-FORTIGATE-MIB::fgSysSesCount.0", "-Ovq");
if (is_numeric($sessions))
{
@@ -30,8 +27,38 @@ if (is_numeric($sessions))
RRA:AVERAGE:0.5:1:800 RRA:AVERAGE:0.5:6:800 RRA:AVERAGE:0.5:24:800 RRA:AVERAGE:0.5:288:800 \
RRA:MAX:0.5:1:800 RRA:MAX:0.5:6:800 RRA:MAX:0.5:24:800 RRA:MAX:0.5:288:800");
}
rrdtool_update($sessrrd,"N:".$ses);
print "Sessions: $sessions\n";
rrdtool_update($sessrrd,"N:".$sessions);
$graphs['fortigate_sessions'] = TRUE;
}
$cpurrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/fortigate_cpu.rrd";
$cpu_usage=snmp_get($device, "FORTINET-FORTIGATE-MIB::fgSysCpuUsage.0", "-Ovq");
if (is_numeric($cpu_usage))
{
if (!is_file($cpurrd))
{
rrdtool_create($cpurrd," --step 300 DS:LOAD:GAUGE:600:-1:100 RRA:AVERAGE:0.5:1:1200 RRA:AVERAGE:0.5:1:2000 \
RRA:AVERAGE:0.5:6:2000 \
RRA:AVERAGE:0.5:24:2000 \
RRA:AVERAGE:0.5:288:2000 \
RRA:MAX:0.5:1:2000 \
RRA:MAX:0.5:6:2000 \
RRA:MAX:0.5:24:2000 \
RRA:MAX:0.5:288:2000 \
RRA:MIN:0.5:1:2000 \
RRA:MIN:0.5:6:2000 \
RRA:MIN:0.5:24:2000 \
RRA:MIN:0.5:288:2000");
}
echo("CPU: $cpu_usage%\n");
rrdtool_update($cpurrd, " N:$cpu_usage");
$graphs['fortigate_cpu'] = TRUE;
}
#$mem=snmp_get($device, "FORTINET-FORTIGATE-MIB::fgSysMemUsage.0", "-Ovq");
#$memsize=snmp_get($device, "FORTINET-FORTIGATE-MIB::fgSysMemCapacity", "-Ovq");
?>