mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
fix sensors (maybe)
git-svn-id: http://www.observium.org/svn/observer/trunk@2236 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
|
||||
## APC
|
||||
if ($device['os'] == "apc")
|
||||
@@ -42,7 +42,7 @@ if ($device['os'] == "apc")
|
||||
{
|
||||
$descr = "Output";
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ if ($device['os'] == "apc")
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", "");
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", "");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ if ($device['os'] == "apc")
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
|
||||
$descr = "Output Feed";
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
|
||||
if ($device['os'] == "gamatronicups")
|
||||
{
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == "gamatronicups")
|
||||
$warnlimit = NULL;
|
||||
$limit = NULL;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor, $cache;
|
||||
|
||||
|
||||
## IPOMANII-MIB
|
||||
if ($device['os'] == "ipoman")
|
||||
@@ -39,7 +39,7 @@ if ($device['os'] == "ipoman")
|
||||
$current = $entry['inletStatusCurrent'] / $divisor;
|
||||
$high_limit = $entry['inletConfigCurrentHigh'] / 10;
|
||||
|
||||
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")
|
||||
$current = $entry['outletStatusCurrent'] / $divisor;
|
||||
$high_limit = $entry['outletConfigCurrentHigh'] / 10;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
|
||||
## MGE UPS
|
||||
if ($device['os'] == "mgeups")
|
||||
@@ -29,7 +29,7 @@ if ($device['os'] == "mgeups")
|
||||
$limit = NULL;
|
||||
$lowwarnlimit = NULL;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
|
||||
if ($device['os'] == "netvision")
|
||||
{
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == "netvision")
|
||||
$warnlimit = NULL;
|
||||
$limit = NULL;
|
||||
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, NULL, NULL, $current);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, NULL, NULL, $current);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
@@ -31,7 +31,7 @@ if ($device['os'] == "netvision")
|
||||
$warnlimit = NULL;
|
||||
$limit = NULL;
|
||||
|
||||
discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, NULL, NULL, $current);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
|
||||
## RFC1628 UPS
|
||||
if ($device['os'] == "netmanplus" || $device['os'] == "deltaups" || $device['os'] == "poweralert")
|
||||
@@ -25,7 +25,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups" || $device['os'
|
||||
$type = "rfc1628";
|
||||
$index = 500+$current_id;
|
||||
|
||||
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" || $device['os'
|
||||
$precision = 1;
|
||||
$index = $i;
|
||||
|
||||
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" || $device['os'
|
||||
$precision = 1;
|
||||
$index = 100+$i;
|
||||
|
||||
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" || $device['os'
|
||||
$precision = 1;
|
||||
$index = 200+$i;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
|
||||
if ($device['os'] == 'sentry3')
|
||||
{
|
||||
@@ -41,7 +41,7 @@ if ($device['os'] == 'sentry3')
|
||||
$current = snmp_get($device,"$infeed_oid", "-Ovq", "Sentry3-MIB") / $divisor;
|
||||
|
||||
if ($current >= 0) {
|
||||
discover_sensor($valid_sensor, 'current', $device, $infeed_oid, $towers, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $infeed_oid, $towers, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
|
||||
#################################
|
||||
@@ -75,7 +75,7 @@ if ($device['os'] == 'sentry3')
|
||||
$outlet_current = snmp_get($device,"$outlet_oid", "-Ovq", "Sentry3-MIB") / $outlet_divisor;
|
||||
|
||||
if ($outlet_current >= 0) {
|
||||
discover_sensor($valid_sensor, 'current', $device, $outlet_oid, $outlet_insert_index, 'sentry3', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'sentry3', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
}
|
||||
} // if ($outlet_data)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
|
||||
## XUPS-MIB
|
||||
if ($device['os'] == "powerware")
|
||||
@@ -25,7 +25,7 @@ if ($device['os'] == "powerware")
|
||||
$type = "xups";
|
||||
$index = "1.2.3.".$current_id;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user