2010-07-03 17:02:39 +00:00
|
|
|
<?php
|
|
|
|
|
2010-07-29 18:25:11 +00:00
|
|
|
global $valid_sensor;
|
2010-07-09 22:38:46 +00:00
|
|
|
|
2010-07-03 17:02:39 +00:00
|
|
|
if($device['os'] == "linux")
|
|
|
|
{
|
2010-07-09 22:38:46 +00:00
|
|
|
# Supermicro sensors
|
|
|
|
$oids = snmp_walk($device, "1.3.6.1.4.1.10876.2.1.1.1.1.3", "-Osqn", "SUPERMICRO-HEALTH-MIB");
|
|
|
|
$oids = trim($oids);
|
|
|
|
if ($oids) echo("Supermicro ");
|
|
|
|
foreach(explode("\n", $oids) as $data)
|
|
|
|
{
|
|
|
|
$data = trim($data);
|
|
|
|
if ($data)
|
2010-07-03 17:02:39 +00:00
|
|
|
{
|
2010-07-09 22:38:46 +00:00
|
|
|
list($oid,$type) = explode(" ", $data);
|
|
|
|
$oid_ex = explode('.',$oid);
|
|
|
|
$index = $oid_ex[count($oid_ex)-1];
|
|
|
|
if ($type == 2)
|
2010-07-03 17:02:39 +00:00
|
|
|
{
|
2010-07-29 18:25:11 +00:00
|
|
|
$temperature_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.4.$index";
|
2010-07-09 22:38:46 +00:00
|
|
|
$descr_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.2.$index";
|
|
|
|
$limit_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.5.$index";
|
|
|
|
$divisor_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.9.$index";
|
|
|
|
$monitor_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.10.$index";
|
|
|
|
$descr = snmp_get($device, $descr_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
2010-07-29 18:25:11 +00:00
|
|
|
$temperature = snmp_get($device, $temperature_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
2010-07-09 22:38:46 +00:00
|
|
|
$limit = snmp_get($device, $limit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
|
|
|
$divisor = snmp_get($device, $divisor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB") || 1;
|
|
|
|
$monitor = snmp_get($device, $monitor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
|
|
|
if ($monitor == 'true')
|
2010-07-03 17:02:39 +00:00
|
|
|
{
|
2010-07-09 22:38:46 +00:00
|
|
|
$descr = trim(str_ireplace("temperature", "", $descr));
|
2010-07-29 18:25:11 +00:00
|
|
|
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, trim($index,'.'), 'supermicro', $descr, $divisor, '1', NULL, NULL, NULL, NULL, $temperature);
|
2010-07-03 17:02:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-07-09 22:38:46 +00:00
|
|
|
}
|
2010-07-03 17:02:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|