mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
5c97185974
git-svn-id: http://www.observium.org/svn/observer/trunk@1325 61d68cd4-352d-0410-923a-c4978735b2b8
42 lines
1.5 KiB
PHP
42 lines
1.5 KiB
PHP
<?php
|
|
|
|
global $valid_temp;
|
|
|
|
if($device['os'] == "linux")
|
|
{
|
|
# 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)
|
|
{
|
|
list($oid,$type) = explode(" ", $data);
|
|
$oid_ex = explode('.',$oid);
|
|
$index = $oid_ex[count($oid_ex)-1];
|
|
if ($type == 2)
|
|
{
|
|
$temp_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.4.$index";
|
|
$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");
|
|
$temp = snmp_get($device, $temp_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
|
$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')
|
|
{
|
|
$descr = trim(str_ireplace("temperature", "", $descr));
|
|
discover_temperature($valid_temp, $device, $temp_oid, trim($index,'.'), "supermicro", $descr, $divisor, $limit, NULL, $temp);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|