mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
reformat mempool and current discovery
git-svn-id: http://www.observium.org/svn/observer/trunk@1834 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -12,7 +12,7 @@ if ($device['os'] == "apc")
|
||||
if ($oids) echo("APC ");
|
||||
$type = "apc";
|
||||
$precision = "10";
|
||||
foreach(explode("\n", $oids) as $data)
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
{
|
||||
$data = trim($data);
|
||||
if ($data)
|
||||
@@ -44,24 +44,24 @@ if ($device['os'] == "apc")
|
||||
}
|
||||
}
|
||||
|
||||
# ATS
|
||||
# ATS
|
||||
$atsCurrent = snmp_get($device, "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1", "-OsqnU", "");
|
||||
if ($atsCurrent)
|
||||
{
|
||||
$current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1";
|
||||
$limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1";
|
||||
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1";
|
||||
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1";
|
||||
$index = 1;
|
||||
$current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1";
|
||||
$limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1";
|
||||
$lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1";
|
||||
$warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1";
|
||||
$index = 1;
|
||||
|
||||
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
||||
$limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, 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));
|
||||
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
|
||||
$limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, 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));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
if ($device['os'] == "gamatronicups")
|
||||
if ($device['os'] == "gamatronicups")
|
||||
{
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
{
|
||||
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.3.$i";
|
||||
$descr = "Input Phase $i";
|
||||
@@ -19,7 +19,7 @@ if ($device['os'] == "gamatronicups")
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current));
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
{
|
||||
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.3.$i";
|
||||
$descr = "Output Phase $i";
|
||||
@@ -34,4 +34,5 @@ if ($device['os'] == "gamatronicups")
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
||||
@@ -7,8 +7,8 @@ if ($device['os'] == "ipoman")
|
||||
{
|
||||
echo(" IPOMANII-MIB ");
|
||||
|
||||
if(!is_array($cache['ipoman']))
|
||||
{
|
||||
if (!is_array($cache['ipoman']))
|
||||
{
|
||||
echo("outletConfigDesc ");
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, "outletConfigDesc", $cache['ipoman']['out'], "IPOMANII-MIB");
|
||||
echo("outletConfigLocation ");
|
||||
@@ -31,9 +31,9 @@ if ($device['os'] == "ipoman")
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, "outletStatusCurrent", $oids_out, "IPOMANII-MIB");
|
||||
// $oids_out = snmpwalk_cache_multi_oid($device, "outletStatusKwatt", $oids_out, "IPOMANII-MIB"); // See above
|
||||
|
||||
if(is_array($oids_in))
|
||||
if (is_array($oids_in))
|
||||
{
|
||||
foreach($oids_in as $index => $entry)
|
||||
foreach ($oids_in as $index => $entry)
|
||||
{
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.3.' . $index;
|
||||
$divisor = 1000;
|
||||
@@ -45,9 +45,9 @@ if ($device['os'] == "ipoman")
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($oids_out))
|
||||
if (is_array($oids_out))
|
||||
{
|
||||
foreach($oids_out as $index => $entry)
|
||||
foreach ($oids_out as $index => $entry)
|
||||
{
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.3.' . $index;
|
||||
$divisor = 1000;
|
||||
@@ -58,4 +58,5 @@ if ($device['os'] == "ipoman")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,7 +3,7 @@
|
||||
global $valid_sensor;
|
||||
|
||||
## MGE UPS
|
||||
if ($device['os'] == "mgeups")
|
||||
if ($device['os'] == "mgeups")
|
||||
{
|
||||
echo("MGE ");
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU"));
|
||||
@@ -28,9 +28,10 @@ if ($device['os'] == "mgeups")
|
||||
$lowlimit = 0;
|
||||
$limit = NULL;
|
||||
$lowwarnlimit = NULL;
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current));
|
||||
|
||||
echo(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"));
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
$numPhase = count(explode("\n",$oids));
|
||||
@@ -53,7 +54,9 @@ if ($device['os'] == "mgeups")
|
||||
$lowlimit = 0;
|
||||
$limit = NULL;
|
||||
$lowwarnlimit = NULL;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
||||
@@ -3,17 +3,17 @@
|
||||
global $valid_sensor;
|
||||
|
||||
## RFC1628 UPS
|
||||
if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
{
|
||||
echo("RFC1628 ");
|
||||
|
||||
|
||||
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.6", "-Osqn", "UPS-MIB");
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
$oids = trim($oids);
|
||||
foreach(explode("\n", $oids) as $data)
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
{
|
||||
$data = trim($data);
|
||||
if ($data)
|
||||
if ($data)
|
||||
{
|
||||
list($oid,$descr) = explode(" ", $data,2);
|
||||
$split_oid = explode('.',$oid);
|
||||
@@ -24,6 +24,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1));
|
||||
$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));
|
||||
}
|
||||
}
|
||||
@@ -39,6 +40,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = $i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
|
||||
}
|
||||
|
||||
@@ -53,6 +55,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 100+$i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
|
||||
}
|
||||
|
||||
@@ -67,8 +70,9 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 200+$i;
|
||||
|
||||
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -6,14 +6,14 @@ global $valid_sensor;
|
||||
if ($device['os'] == "powerware")
|
||||
{
|
||||
echo("XUPS-MIB ");
|
||||
|
||||
|
||||
$oids = snmp_walk($device, "xupsBatCurrent", "-Osqn", "XUPS-MIB");
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
$oids = trim($oids);
|
||||
foreach(explode("\n", $oids) as $data)
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
{
|
||||
$data = trim($data);
|
||||
if ($data)
|
||||
if ($data)
|
||||
{
|
||||
list($oid,$descr) = explode(" ", $data,2);
|
||||
$split_oid = explode('.',$oid);
|
||||
@@ -24,6 +24,7 @@ if ($device['os'] == "powerware")
|
||||
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1));
|
||||
$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));
|
||||
}
|
||||
}
|
||||
@@ -39,6 +40,7 @@ if ($device['os'] == "powerware")
|
||||
$type = "xups";
|
||||
$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));
|
||||
}
|
||||
|
||||
@@ -53,8 +55,9 @@ if ($device['os'] == "powerware")
|
||||
$type = "xups";
|
||||
$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));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user