2010-07-03 17:02:39 +00:00
|
|
|
<?php
|
|
|
|
|
2011-05-04 11:04:19 +00:00
|
|
|
|
2010-07-29 18:25:11 +00:00
|
|
|
|
2011-03-15 09:57:13 +00:00
|
|
|
if ($device['os_group'] == "unix")
|
2010-07-09 22:38:46 +00:00
|
|
|
{
|
|
|
|
# FIXME snmp_walk
|
2010-07-10 12:17:58 +00:00
|
|
|
# ObserverNMS-style temperature
|
2011-03-18 16:11:50 +00:00
|
|
|
$cmd = $config['snmpwalk'] . " -M " . $config['mibdir'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -CI -c ".$device['community']." ".$device['transport'].":".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891 | sed s/.1.3.6.1.4.1.2021.7891.// | grep '.1.1 ' | grep -v '.101.' | cut -d'.' -f 1";
|
2011-03-31 10:51:02 +00:00
|
|
|
if ($debug) { echo("$cmd\n"); }
|
2011-03-18 16:11:50 +00:00
|
|
|
$oids = shell_exec($cmd);
|
2010-07-09 22:38:46 +00:00
|
|
|
$oids = trim($oids);
|
|
|
|
if ($oids) echo("Observer-Style ");
|
2011-03-15 09:57:13 +00:00
|
|
|
foreach (explode("\n",$oids) as $oid)
|
2010-07-09 22:38:46 +00:00
|
|
|
{
|
|
|
|
$oid = trim($oid);
|
|
|
|
if ($oid != "")
|
2010-07-03 17:02:39 +00:00
|
|
|
{
|
2010-07-09 22:38:46 +00:00
|
|
|
# FIXME snmp_get
|
2011-03-18 16:11:50 +00:00
|
|
|
$descr_query = $config['snmpget'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -c ".$device['community']." ".$device['transport'].':'.$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891.$oid.2.1 | sed s/.1.3.6.1.4.1.2021.7891.$oid.2.1\ //";
|
2010-07-09 22:38:46 +00:00
|
|
|
$descr = trim(str_replace("\"", "", shell_exec($descr_query)));
|
|
|
|
$fulloid = ".1.3.6.1.4.1.2021.7891.$oid.101.1";
|
2011-05-04 11:04:19 +00:00
|
|
|
discover_sensor($valid['sensor'], 'temperature', $device, $fulloid, $oid, 'observium', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
2010-07-03 17:02:39 +00:00
|
|
|
}
|
|
|
|
}
|
2010-07-09 22:38:46 +00:00
|
|
|
}
|
2010-07-03 17:02:39 +00:00
|
|
|
|
2011-03-15 09:57:13 +00:00
|
|
|
?>
|