mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix voltage limits
git-svn-id: http://www.observium.org/svn/observer/trunk@871 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -58,7 +58,7 @@ function discover_volt($device, $oid, $index, $type, $descr, $precision = 1, $lo
|
||||
if (mysql_result(mysql_query("SELECT count(volt_id) FROM `voltage` WHERE device_id = '".$device['device_id']."' AND volt_type = '$type' AND `volt_index` = '$index'"),0) == '0')
|
||||
{
|
||||
$query = "INSERT INTO voltage (`device_id`, `volt_oid`, `volt_index`, `volt_type`, `volt_descr`, `volt_precision`, `volt_limit`, `volt_limit_low`, `volt_current`) ";
|
||||
$query .= " VALUES ('".$device['device_id']."', '$oid', '$index', '$type', '$descr', '$precision', '$low_limit', '$volt_limit_low', '$current')";
|
||||
$query .= " VALUES ('".$device['device_id']."', '$oid', '$index', '$type', '$descr', '$precision', '$high_limit', '$low_limit', '$current')";
|
||||
mysql_query($query);
|
||||
if($debug) { echo("$query ". mysql_affected_rows() . " inserted"); }
|
||||
echo("+");
|
||||
|
@@ -56,15 +56,15 @@ if ($device['os'] == "linux")
|
||||
$volt_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;
|
||||
$monitor_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.10.".$index;
|
||||
$limit_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.5.".$index;
|
||||
$lowlimit_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.6.".$index;
|
||||
$limit_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.6.".$index;
|
||||
$lowlimit_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.5.".$index;
|
||||
|
||||
$descr = snmp_get($device, $descr_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$limit = snmp_get($device, $limit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$monitor = snmp_get($device, $monitor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$descr = trim(str_ireplace("Voltage", "", $descr));
|
||||
$descr = snmp_get($device, $descr_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$limit = snmp_get($device, $limit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$monitor = snmp_get($device, $monitor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
$descr = trim(str_ireplace("Voltage", "", $descr));
|
||||
|
||||
if ($monitor == 'true')
|
||||
{
|
||||
|
Reference in New Issue
Block a user