mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
Raritan PX iPDU inlet support
This commit is contained in:
@@ -6,7 +6,33 @@ if ($device['os'] == 'raritan')
|
||||
{
|
||||
$divisor = "1000";
|
||||
$outlet_divisor = $divisor;
|
||||
$inlet_divisor = 10.0;
|
||||
$multiplier = "1";
|
||||
// Check Inlets
|
||||
$inlet_oids = snmp_walk($device,"inletLabel","-Osqn","PDU2-MIB");
|
||||
$inlet_oids = trim($inlet_oids);
|
||||
if ($inlet_oids) echo("PDU Inlet ");
|
||||
foreach (explode("\n", $inlet_oids) as $inlet_data)
|
||||
{
|
||||
$inlet_data = trim($inlet_data);
|
||||
if ($inlet_data)
|
||||
{
|
||||
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];
|
||||
|
||||
$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_current = snmp_get($device, "measurementsInletSensorValue.1.$inletsuffix.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////
|
||||
# Check for per-outlet polling
|
||||
|
||||
Reference in New Issue
Block a user