This commit is contained in:
Rudy Hardeman
2015-05-17 18:25:03 +02:00
parent 39ae2f3578
commit 14fd2dd89f
3 changed files with 15 additions and 24 deletions

View File

@@ -19,17 +19,14 @@ if ($device['os'] == 'raritan')
{
list($inlet_oid,$inlet_descr) = explode(" ", $inlet_data,2);
$inlet_split_oid = explode('.', $inlet_oid);
$inlet_index = $inlet_split_oid[count($inlet_split_oid)-1];
$inlet_index = $inlet_split_oid[count($inlet_split_oid)-2].".".$inlet_split_oid[count($inlet_split_oid)-1];
$inletsuffix = "$inlet_index";
$inlet_insert_index = $inlet_index;
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.$inletsuffix.1";
$inlet_divisor = pow(10,snmp_get($device, "inletSensorDecimalDigits.1.$inletsuffix.rmsCurrent", "-Ovq","PDU2-MIB"));
$inlet_current = snmp_get($device, "measurementsInletSensorValue.1.$inletsuffix.1", "-Ovq","PDU2-MIB") / $inlet_divisor;
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.1";
$inlet_divisor = pow(10,snmp_get($device, "inletSensorDecimalDigits.$inlet_index.rmsCurrent", "-Ovq","PDU2-MIB"));
$inlet_current = snmp_get($device, "measurementsInletSensorValue.$inlet_index.1", "-Ovq","PDU2-MIB") / $inlet_divisor;
if ($inlet_current >= 0) {
discover_sensor($valid['sensor'], 'current', $device, $inlet_oid, $inlet_insert_index, 'raritan', $inlet_descr, $inlet_divisor, $multiplier, NULL, NULL, NULL, NULL, $inlet_current);
discover_sensor($valid['sensor'], 'current', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, $multiplier, NULL, NULL, NULL, NULL, $inlet_current);
}
}
}

View File

@@ -13,17 +13,14 @@ if ($device['os'] == 'raritan')
{
list($inlet_oid,$inlet_descr) = explode(" ", $inlet_data,2);
$inlet_split_oid = explode('.', $inlet_oid);
$inlet_index = $inlet_split_oid[count($inlet_split_oid)-1];
$inlet_index = $inlet_split_oid[count($inlet_split_oid)-2].".".$inlet_split_oid[count($inlet_split_oid)-1];
$inletsuffix = "$inlet_index";
$inlet_insert_index = $inlet_index;
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.$inletsuffix.23";
$inlet_divisor = pow(10,snmp_get($device, "inletSensorDecimalDigits.1.$inletsuffix.frequency", "-Ovq","PDU2-MIB"));
$inlet_frequency = snmp_get($device, "measurementsInletSensorValue.$inletsuffix.1.frequency", "-Ovq", "PDU2-MIB") / $inlet_divisor;
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.23";
$inlet_divisor = pow(10,snmp_get($device, "inletSensorDecimalDigits.$inlet_index.frequency", "-Ovq","PDU2-MIB"));
$inlet_frequency = snmp_get($device, "measurementsInletSensorValue.$inlet_index.frequency", "-Ovq", "PDU2-MIB") / $inlet_divisor;
if ($inlet_frequency >= 0) {
discover_sensor($valid['sensor'], 'frequency', $device, $inlet_oid, $inlet_insert_index, 'raritan', $inlet_descr, $inlet_divisor, 1, NULL, NULL, NULL, NULL, $inlet_frequency);
discover_sensor($valid['sensor'], 'frequency', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, 1, NULL, NULL, NULL, NULL, $inlet_frequency);
}
}
}

View File

@@ -13,17 +13,14 @@ if ($device['os'] == 'raritan')
{
list($inlet_oid,$inlet_descr) = explode(" ", $inlet_data,2);
$inlet_split_oid = explode('.', $inlet_oid);
$inlet_index = $inlet_split_oid[count($inlet_split_oid)-1];
$inlet_index = $inlet_split_oid[count($inlet_split_oid)-2].".".$inlet_split_oid[count($inlet_split_oid)-1];
$inletsuffix = "$inlet_index";
$inlet_insert_index = $inlet_index;
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.$inletsuffix.5";
$inlet_divisor = pow(10,snmp_get($device, "inletSensorDecimalDigits.1.$inletsuffix.activePower", "-Ovq","PDU2-MIB"));
$inlet_power = snmp_get($device, "measurementsInletSensorValue.$inletsuffix.1.activePower", "-Ovq", "PDU2-MIB") / $inlet_divisor;
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.5";
$inlet_divisor = pow(10,snmp_get($device, "inletSensorDecimalDigits.$inlet_index.activePower", "-Ovq","PDU2-MIB"));
$inlet_power = snmp_get($device, "measurementsInletSensorValue.$inlet_index.activePower", "-Ovq", "PDU2-MIB") / $inlet_divisor;
if ($inlet_power >= 0) {
discover_sensor($valid['sensor'], 'power', $device, $inlet_oid, $inlet_insert_index, 'raritan', $inlet_descr, $inlet_divisor, 1, NULL, NULL, NULL, NULL, $inlet_power);
discover_sensor($valid['sensor'], 'power', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, 1, NULL, NULL, NULL, NULL, $inlet_power);
}
}
}