migrate all SNMP calls to use $config['mibdir']. automatically generated from install_dir if not present

git-svn-id: http://www.observium.org/svn/observer/trunk@1284 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-02 19:58:13 +00:00
parent b991efa9a6
commit c22e8493f7
53 changed files with 168 additions and 128 deletions
+5 -3
View File
@@ -2,8 +2,10 @@
echo("Fortinet Fortigate Poller\n");
$fnSysVersion = shell_exec($config['snmpget']." -m FORTINET-MIB-280 -".$device['snmpver']." -Ovq -c ".$device['community']." ".$device['hostname'].":".$device['port']." fnSysVersion.0");
$serial = shell_exec($config['snmpget']." -m FORTINET-MIB-280 -".$device['snmpver']." -Ovq -c ".$device['community']." ".$device['hostname'].":".$device['port']." fnSysSerial.0");
## FIX ME - find some fortigate hardware to test this on, and to update and generify it
$fnSysVersion = shell_exec($config['snmpget']. " -M ".$config['mibdir']." -m FORTINET-MIB-280 -".$device['snmpver']." -Ovq -c ".$device['community']." ".$device['hostname'].":".$device['port']." fnSysVersion.0");
$serial = shell_exec($config['snmpget']. " -M ".$config['mibdir']." -m FORTINET-MIB-280 -".$device['snmpver']." -Ovq -c ".$device['community']." ".$device['hostname'].":".$device['port']." fnSysSerial.0");
$version = preg_replace("/(.+)\ (.+),(.+),(.+)/", "Fortinet \\1||\\2||\\3||\\4", $fnSysVersion);
list($hardware,$version,$features) = explode("||", $version);
@@ -12,7 +14,7 @@ $cpurrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/fortigate-cpu.rrd
$memrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/fortigate-memory.rrd";
$sessrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/fortigate-sessions.rrd";
$cmd = $config['snmpget'] . " -m FORTINET-MIB-280 -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'];
$cmd = $config['snmpget'] . " -M ".$config['mibdir']. " -m FORTINET-MIB-280 -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'];
$cmd .= " fnSysCpuUsage.0 fnSysMemUsage.0 fnSysSesCount.0 fnSysMemCapacity.0";
$data = shell_exec($cmd);
list ($cpu, $mem, $ses, $memsize) = explode("\n", $data);