mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
more reformat and optimization
git-svn-id: http://www.observium.org/svn/observer/trunk@1837 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -40,7 +40,7 @@ if ($device['os'] == "apc")
|
||||
{
|
||||
$descr = "Output";
|
||||
}
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ if ($device['os'] == "apc")
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||
$descr = "Output Feed";
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == "gamatronicups")
|
||||
$warnlimit = NULL;
|
||||
$limit = NULL;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
@@ -31,7 +31,7 @@ if ($device['os'] == "gamatronicups")
|
||||
$warnlimit = NULL;
|
||||
$limit = NULL;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ if ($device['os'] == "ipoman")
|
||||
$descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') : "Inlet $index");
|
||||
$current = $entry['inletStatusCurrent'] / $divisor;
|
||||
$high_limit = $entry['inletConfigCurrentHigh'] / 10;
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current);
|
||||
# FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ if ($device['os'] == "ipoman")
|
||||
$descr = (trim($cache['ipoman']['out'][$index]['outletConfigDesc'],'"') != '' ? trim($cache['ipoman']['out'][$index]['outletConfigDesc'],'"') : "Output $index");
|
||||
$current = $entry['outletStatusCurrent'] / $divisor;
|
||||
$high_limit = $entry['outletConfigCurrentHigh'] / 10;
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ if ($device['os'] == "mgeups")
|
||||
$limit = NULL;
|
||||
$lowwarnlimit = NULL;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
|
||||
@@ -55,7 +55,7 @@ if ($device['os'] == "mgeups")
|
||||
$limit = NULL;
|
||||
$lowwarnlimit = NULL;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$type = "rfc1628";
|
||||
$index = 500+$current_id;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$precision = 1;
|
||||
$index = $i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU"));
|
||||
@@ -56,7 +56,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$precision = 1;
|
||||
$index = 100+$i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.5.2.0", "-OsqnU"));
|
||||
@@ -71,7 +71,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$precision = 1;
|
||||
$index = 200+$i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ if ($device['os'] == "powerware")
|
||||
$type = "xups";
|
||||
$index = "1.2.3.".$current_id;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ if ($device['os'] == "powerware")
|
||||
$divisor = 1;
|
||||
$index = "4.4.1.3.".$i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "xupsInputCurrent", "-OsqnU", "XUPS-MIB"));
|
||||
@@ -56,7 +56,7 @@ if ($device['os'] == "powerware")
|
||||
$divisor = 1;
|
||||
$index = "3.4.1.3.".$i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ if ($device['os'] == "areca")
|
||||
$index = $split_oid[count($split_oid)-1];
|
||||
$oid = "1.3.6.1.4.1.18928.1.2.2.1.9.1.3." . $index;
|
||||
$current = snmp_get($device, $oid, "-Oqv", "");
|
||||
|
||||
discover_sensor($valid_sensor, 'fanspeed', $device, $oid, $index, 'areca', trim($descr,'"'), '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ if ($device['os'] == "linux")
|
||||
$oid = "1.3.6.1.4.1.2021.13.16.3.1.3.". $index;
|
||||
$current = snmp_get($device, $oid, "-Oqv", "LM-SENSORS-MIB");
|
||||
$descr = trim(str_ireplace("fan-", "", $descr));
|
||||
if($current > '0') {
|
||||
if ($current > '0')
|
||||
{
|
||||
discover_sensor($valid_sensor, 'fanspeed', $device, $oid, $index, 'lmsensors', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,4 +69,5 @@ if ($device['os'] == "apc")
|
||||
discover_sensor($valid_sensor, 'freq', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -36,9 +36,10 @@ if ($device['os'] == "ipoman")
|
||||
$current = $entry['inletStatusFrequency'] / 10;
|
||||
$low_limit = $entry['inletConfigFrequencyLow'];
|
||||
$high_limit = $entry['inletConfigFrequencyHigh'];
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current);
|
||||
# FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -23,7 +23,7 @@ if ($device['os'] == "mgeups")
|
||||
$type = "mge-ups";
|
||||
$divisor = 10;
|
||||
$index = $i;
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
@@ -42,7 +42,8 @@ if ($device['os'] == "mgeups")
|
||||
$type = "mge-ups";
|
||||
$divisor = 10;
|
||||
$index = 100+$i;
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -18,7 +18,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$type = "rfc1628";
|
||||
$divisor = 10;
|
||||
$index = '3.2.0.'.$i;
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$freq_oid = "1.3.6.1.2.1.33.1.4.2.0";
|
||||
@@ -27,7 +27,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$type = "rfc1628";
|
||||
$divisor = 10;
|
||||
$index = '4.2.0';
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
|
||||
$freq_oid = "1.3.6.1.2.1.33.1.5.1.0";
|
||||
$descr = "Bypass";
|
||||
@@ -35,6 +35,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$type = "rfc1628";
|
||||
$divisor = 10;
|
||||
$index = '5.1.0';
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == "powerware")
|
||||
$current = snmp_get($device, $freq_oid, "-Oqv") / $divisor;
|
||||
$type = "xups";
|
||||
$index = '3.1.0';
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
|
||||
# XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500
|
||||
$freq_oid = "1.3.6.1.4.1.534.1.4.2.0";
|
||||
@@ -25,7 +25,7 @@ if ($device['os'] == "powerware")
|
||||
$current = snmp_get($device, $freq_oid, "-Oqv") / $divisor;
|
||||
$type = "xups";
|
||||
$index = '4.2.0';
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
|
||||
# XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500
|
||||
$freq_oid = "1.3.6.1.4.1.534.1.5.1.0";
|
||||
@@ -38,7 +38,8 @@ if ($device['os'] == "powerware")
|
||||
$current /= $divisor;
|
||||
$type = "xups";
|
||||
$index = '5.1.0';
|
||||
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -14,6 +14,7 @@ if ($device['os'] == "apc")
|
||||
$type = "apc";
|
||||
$index = 0;
|
||||
$descr = "Internal Temperature";
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'apc', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ if ($device['os'] == "areca")
|
||||
$index = $split_oid[count($split_oid)-1];
|
||||
$oid = "1.3.6.1.4.1.18928.1.2.2.1.10.1.3." . $index;
|
||||
$current = snmp_get($device, $oid, "-Oqv", "");
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'areca', trim($descr,'"'), '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ if (mysql_result(mysql_query("SELECT COUNT(*) FROM `sensors` WHERE `device_id` =
|
||||
$descr = str_replace("temperature", "", $descr);
|
||||
$descr = str_replace("temperature", "", $descr);
|
||||
$descr = trim($descr);
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'cisco', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ if (strstr($device['hardware'], "dell"))
|
||||
$descr = trim(str_replace("\"", "", shell_exec($descr_query)));
|
||||
$fulloid = ".1.3.6.1.4.1.674.10892.1.700.20.1.6.$oid";
|
||||
$temp = snmp_get($device, $fulloid, "-Oqv");
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $fulloid, $oid, 'dell', $descr, '10', '1', NULL, NULL, NULL, NULL, $temp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,12 @@ if ($device['os'] == "ftos" || $device['os_group'] == "ftos")
|
||||
$descr = "Slot ".$index;
|
||||
$oid = ".1.3.6.1.4.1.6027.3.8.1.2.1.1.5.".$index;
|
||||
$current = $entry['chSysCardTemp'];
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'ftos-cseries', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -24,13 +24,12 @@ if ($device['os'] == "ftos" || $device['os_group'] == "ftos")
|
||||
$descr = "Slot ".$index;
|
||||
$oid = ".1.3.6.1.4.1.6027.3.1.1.2.3.1.8.".$index;
|
||||
$current = $entry['chSysCardUpperTemp'];
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'ftos-eseries', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -14,7 +14,6 @@ if ($device['os'] == "ftos" || $device['os_group'] == "ftos")
|
||||
$oids = snmpwalk_cache_oid($device, "chStackUnitTemp", array(), "F10-S-SERIES-CHASSIS-MIB", $config['mib_dir'].":".$config['mib_dir']."/ftos" );
|
||||
$oids = snmpwalk_cache_oid($device, "chStackUnitSysType", $oids, "F10-S-SERIES-CHASSIS-MIB", $config['mib_dir'].":".$config['mib_dir']."/ftos" );
|
||||
|
||||
|
||||
if (is_array($oids))
|
||||
{
|
||||
foreach ($oids as $index => $entry)
|
||||
@@ -22,13 +21,12 @@ if ($device['os'] == "ftos" || $device['os_group'] == "ftos")
|
||||
$descr = "Unit ".$index . " " . $entry['chStackUnitSysType'];
|
||||
$oid = ".1.3.6.1.4.1.6027.3.10.1.2.2.1.14.".$index;
|
||||
$current = $entry['chStackUnitTemp'];
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'ftos-sseries', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
# FIXME: EMD "stack" support
|
||||
# FIXME: EMD "stack" support?
|
||||
# FIXME: What to do with IPOMANII-MIB::ipmEnvEmdConfigTempOffset.0 ?
|
||||
|
||||
global $valid_sensor;
|
||||
@@ -21,6 +21,7 @@ if ($device['os'] == "ipoman")
|
||||
{
|
||||
$current_oid = ".1.3.6.1.4.1.2468.1.4.2.1.5.1.1.2.0";
|
||||
$descr = trim(str_replace("\"", "", $descr));
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $current_oid, "1", 'ipoman', $descr, '10', '1', $low_limit, NULL, NULL, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ if ($device['os'] == "junos" || $device['os_group'] == "junos")
|
||||
$descr = str_replace("temperature", "", $descr);
|
||||
$descr = str_replace("sensor", "", $descr);
|
||||
$descr = trim($descr);
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $oid, 'junos', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ if ($device['os'] == "junose")
|
||||
$descr = str_replace("temperature sensor on", "", trim($descr));
|
||||
$oid = ".1.3.6.1.4.1.4874.2.2.2.1.9.4.1.3.".$index;
|
||||
$current = $entry['juniSystemTempValue'];
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'junose', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ if ($device['os'] == "powerconnect")
|
||||
$type = "powerconnect";
|
||||
$index = "0";
|
||||
$descr = "Internal Temperature";
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, $type, $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ if($device['os'] == "netmanplus" || $device['os'] == 'deltaups')
|
||||
$temperature_oid = "1.3.6.1.2.1.33.1.2.7.$temperature_id";
|
||||
$temperature = snmp_get($device, $temperature_oid, "-Ovq");
|
||||
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($temperature_id+1));
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $temperature_id, 'rfc1628', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ if($device['os'] == "powerware")
|
||||
$highlimit = snmp_get($device,"upsEnvAmbientUpperLimit.$temperature_id", "-Ovq", "XUPS-MIB");
|
||||
$temperature = snmp_get($device, $temperature_oid, "-Ovq");
|
||||
$descr = "Ambient" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($temperature_id+1));
|
||||
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, '1.6.1.'.$temperature_id, 'powerware', $descr, '1', '1', $lowlimit, NULL, NULL, $highlimit, $temperature);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ global $valid_sensor;
|
||||
|
||||
if ($device['os'] == 'ies')
|
||||
{
|
||||
|
||||
echo("ZyXEL IES ");
|
||||
|
||||
$oids = array();
|
||||
@@ -25,4 +24,5 @@ if ($device['os'] == 'ies')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -20,8 +20,8 @@ if ($device['os'] == "apc")
|
||||
$index = $split_oid[count($split_oid)-3];
|
||||
$oid = "1.3.6.1.4.1.318.1.1.8.5.3.3.1.3." . $index . ".1.1";
|
||||
$descr = "Input Feed " . chr(64+$index);
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, "3.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, "3.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,8 @@ if ($device['os'] == "apc")
|
||||
$index = $split_oid[count($split_oid)-3];
|
||||
$oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.3." . $index . ".1.1";
|
||||
$descr = "Output Feed"; if (count(explode("\n", $oids)) > 1) { $descr .= " $index"; }
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, "4.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, "4.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +55,8 @@ if ($device['os'] == "apc")
|
||||
$type = "apc";
|
||||
$index = "3.2.1.0";
|
||||
$descr = "Input";
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$oids = snmp_get($device, "1.3.6.1.4.1.318.1.1.1.4.2.1.0", "-OsqnU", "");
|
||||
@@ -67,7 +69,9 @@ if ($device['os'] == "apc")
|
||||
$type = "apc";
|
||||
$index = "4.2.1.0";
|
||||
$descr = "Output";
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -22,9 +22,10 @@ if ($device['os'] == "areca")
|
||||
$current = snmp_get($device, $oid, "-Oqv", "") / $divisor;
|
||||
if ($descr != '"Battery Status"' || $current != 0.255) # FIXME not sure if this is supposed to be a voltage, but without BBU it's 225, then ignore.
|
||||
{
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, trim($descr,'"'), $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, trim($descr,'"'), $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -14,7 +14,8 @@ if ($device['os'] == "gamatronicups")
|
||||
$index = $i;
|
||||
$lowlimit = 0;
|
||||
$limit = NULL;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt);
|
||||
}
|
||||
|
||||
for($i = 1; $i <= 3 ;$i++)
|
||||
@@ -27,8 +28,9 @@ if ($device['os'] == "gamatronicups")
|
||||
$index = 100+$i;
|
||||
$lowlimit = 0;
|
||||
$limit = NULL;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -36,9 +36,11 @@ if ($device['os'] == "ipoman")
|
||||
$current = $entry['inletStatusVoltage'] / 10;
|
||||
$low_limit = $entry['inletConfigVoltageLow'];
|
||||
$high_limit = $entry['inletConfigVoltageHigh'];
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current);
|
||||
# FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -10,6 +10,7 @@ if ($device['os'] == "linux")
|
||||
if ($oids) echo("LM-SENSORS ");
|
||||
$divisor = 1000;
|
||||
$type = "lmsensors";
|
||||
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
{
|
||||
$data = trim($data);
|
||||
@@ -20,8 +21,10 @@ if ($device['os'] == "linux")
|
||||
$index = $split_oid[count($split_oid)-1];
|
||||
$oid = "1.3.6.1.4.1.2021.13.16.4.1.3." . $index;
|
||||
$current = snmp_get($device, $oid, "-Oqv", "LM-SENSORS-MIB") / $divisor;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -23,7 +23,8 @@ if ($device['os'] == "mgeups")
|
||||
$type = "mge-ups";
|
||||
$divisor = 10;
|
||||
$index = $i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "mgeinputVoltage", "-OsqnU", "MG-SNMP-UPS-MIB"));
|
||||
@@ -43,7 +44,9 @@ if ($device['os'] == "mgeups")
|
||||
$type = "mge-ups";
|
||||
$divisor = 10;
|
||||
$index = 100+$i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -24,7 +24,8 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($volt_id+1));
|
||||
$type = "rfc1628";
|
||||
$index = "1.2.5.".$volt_id;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +40,8 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; };
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
|
||||
$index = $i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU"));
|
||||
@@ -53,7 +55,8 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; };
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
|
||||
$index = 100+$i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.5.2.0", "-OsqnU"));
|
||||
@@ -67,7 +70,9 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; };
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
|
||||
$index = 200+$i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -36,10 +36,11 @@ if ($device['os'] == "linux")
|
||||
|
||||
if ($monitor == 'true')
|
||||
{
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', $lowlimit, NULL, NULL, $limit, $current));
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', $lowlimit, NULL, NULL, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -25,7 +25,8 @@ if ($device['os'] == "powerware")
|
||||
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($volt_id+1));
|
||||
$type = "xups";
|
||||
$index = '1.2.5.'.$volt_id;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +43,8 @@ if ($device['os'] == "powerware")
|
||||
$divisor = 1;
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
|
||||
$index = '3.4.1.2.'.$i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
# XUPS-MIB::xupsOutputNumPhases.0 = INTEGER: 1
|
||||
@@ -58,7 +60,8 @@ if ($device['os'] == "powerware")
|
||||
$divisor = 1;
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
|
||||
$index = '4.4.1.2.'.$i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
# XUPS-MIB::xupsBypassNumPhases.0 = INTEGER: 1
|
||||
@@ -73,7 +76,9 @@ if ($device['os'] == "powerware")
|
||||
$divisor = 1;
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
|
||||
$index = '5.3.1.2.'.$i;
|
||||
echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user