mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Eaton/MGE UPS reorganization (#6388)
* Eaton UPS cleanup * newdevice: Eaton/MGE UPS cleanup MGE split Galaxy (and Upsilon) to apc-mgeups All others to eaton-mgeups Remove mge ups from eatonups os. Remove powerware it is a duplicate of eatonups * Add rfc1528 for both mgeups os * Update overview graphs
This commit is contained in:
committed by
Neil Lathwood
parent
056ddbac05
commit
43914fbc7f
19
includes/definitions/apc-mgeups.yaml
Normal file
19
includes/definitions/apc-mgeups.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
os: apc-mgeups
|
||||
text: 'APC MGE UPS'
|
||||
group: ups
|
||||
type: power
|
||||
icon: apc
|
||||
rfc1628_compat: 1
|
||||
mib_dir:
|
||||
- mge
|
||||
over:
|
||||
- { graph: device_current, text: Current }
|
||||
- { graph: device_voltage, text: Voltage }
|
||||
- { graph: device_load, text: Load }
|
||||
discovery:
|
||||
-
|
||||
sysObjectId:
|
||||
- .1.3.6.1.4.1.705.1
|
||||
sysDescr_regex:
|
||||
- '/^Galaxy/'
|
||||
# Upsilon too (no data)
|
||||
@@ -1,13 +1,15 @@
|
||||
os: powerware
|
||||
text: 'Powerware UPS'
|
||||
os: eaton-mgeups
|
||||
text: 'Eaton MGE UPS'
|
||||
group: ups
|
||||
type: power
|
||||
icon: eaton
|
||||
over:
|
||||
- { graph: device_voltage, text: Voltage }
|
||||
- { graph: device_current, text: Current }
|
||||
- { graph: device_frequency, text: Frequencies }
|
||||
rfc1628_compat: 1
|
||||
mib_dir:
|
||||
- ups
|
||||
- mge
|
||||
over:
|
||||
- { graph: device_current, text: Current }
|
||||
- { graph: device_voltage, text: Voltage }
|
||||
- { graph: device_load, text: Load }
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.534
|
||||
- .1.3.6.1.4.1.705.1
|
||||
@@ -7,4 +7,4 @@ mib_dir:
|
||||
over:
|
||||
- { graph: device_current, text: Current }
|
||||
discovery:
|
||||
- sysObjectId: .1.3.6.1.4.1.534.6.6.7
|
||||
- sysObjectId: .1.3.6.1.4.1.534.6.
|
||||
|
||||
@@ -9,5 +9,5 @@ over:
|
||||
mib_dir:
|
||||
- ups
|
||||
discovery:
|
||||
- sysObjectId: .1.3.6.1.4.1.534.
|
||||
- sysDescr: 'Eaton 5P'
|
||||
- sysObjectId: .1.3.6.1.4.1.534.1
|
||||
- sysObjectId: .1.3.6.1.4.1.534.2
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
os: mgepdu
|
||||
text: 'MGE PDU'
|
||||
text: 'Eaton MGE PDU'
|
||||
type: power
|
||||
icon: mge
|
||||
icon: eaton
|
||||
mib_dir:
|
||||
- mge
|
||||
over:
|
||||
- { graph: device_current, text: Current }
|
||||
discovery:
|
||||
- sysDescr:
|
||||
- MGE Switched PDU
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.705.2
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
os: mgeups
|
||||
text: 'APC UPS'
|
||||
group: ups
|
||||
type: power
|
||||
icon: apc
|
||||
mib_dir:
|
||||
- mge
|
||||
over:
|
||||
- { graph: device_current, text: Current }
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.705.1
|
||||
- sysDescr:
|
||||
- 'Pulsar M'
|
||||
- 'MGE UPS SYSTEMS - Network Management Proxy'
|
||||
- sysDescr_regex:
|
||||
- '/^Galaxy/'
|
||||
- '/^Evolution/'
|
||||
- '/^Comet/'
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
$oids = snmp_walk($device, 'xupsBatCurrent', '-Osqn', 'XUPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.2.3.$current_id";
|
||||
$divisor = 1;
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, 'xupsOutputCurrent', '-OsqnU', 'XUPS-MIB'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.4.4.1.3.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'xups';
|
||||
$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);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, 'xupsInputCurrent', '-OsqnU', 'XUPS-MIB'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.3.4.1.3.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'xups';
|
||||
$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);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
// I'm not sure if there is provision for frequency of multiple phases in this MIB -TL
|
||||
// XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500
|
||||
$freq_oid = '.1.3.6.1.4.1.534.1.3.1.0';
|
||||
$descr = 'Input';
|
||||
$divisor = 10;
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / $divisor);
|
||||
$type = 'xups';
|
||||
$index = '3.1.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
// XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500
|
||||
$freq_oid = '.1.3.6.1.4.1.534.1.4.2.0';
|
||||
$descr = 'Output';
|
||||
$divisor = 10;
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / $divisor);
|
||||
$type = 'xups';
|
||||
$index = '4.2.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
// XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500
|
||||
$freq_oid = '.1.3.6.1.4.1.534.1.5.1.0';
|
||||
$descr = 'Bypass';
|
||||
$divisor = 10;
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
if ($current != '') {
|
||||
// Bypass is not always available in SNMP
|
||||
$current /= $divisor;
|
||||
$type = 'xups';
|
||||
$index = '5.1.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
// XUPS-MIB::xupsEnvAmbientTemp.0 = INTEGER: 52
|
||||
// XUPS-MIB::xupsEnvAmbientLowerLimit.0 = INTEGER: 0
|
||||
// XUPS-MIB::xupsEnvAmbientUpperLimit.0 = INTEGER: 70
|
||||
$oids = snmp_walk($device, 'xupsEnvAmbientTemp', '-Osqn', 'XUPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'Powerware Ambient Temperature ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$temperature_id = $split_oid[(count($split_oid) - 1)];
|
||||
$temperature_oid = ".1.3.6.1.4.1.534.1.6.1.$temperature_id";
|
||||
$lowlimit = snmp_get($device, "upsEnvAmbientLowerLimit.$temperature_id", '-Ovq', 'XUPS-MIB');
|
||||
$highlimit = snmp_get($device, "upsEnvAmbientUpperLimit.$temperature_id", '-Ovq', 'XUPS-MIB');
|
||||
$temperature = snmp_get($device, $temperature_oid, '-Ovq');
|
||||
$descr = 'Ambient'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($temperature_id + 1));
|
||||
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, '1.6.1.'.$temperature_id, 'powerware', $descr, '1', '1', $lowlimit, null, null, $highlimit, $temperature);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
// XUPS-MIB::xupsBatVoltage.0 = INTEGER: 51
|
||||
$oids = snmp_walk($device, 'xupsBatVoltage', '-Osqn', 'XUPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$volt_id = $split_oid[(count($split_oid) - 1)];
|
||||
$volt_oid = ".1.3.6.1.4.1.534.1.2.2.$volt_id";
|
||||
$divisor = 1;
|
||||
$volt = (snmp_get($device, $volt_oid, '-O vq') / $divisor);
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($volt_id + 1));
|
||||
$type = 'xups';
|
||||
$index = '1.2.5.'.$volt_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $volt);
|
||||
}
|
||||
}
|
||||
|
||||
// XUPS-MIB::xupsInputNumPhases.0 = INTEGER: 1
|
||||
$oids = trim(snmp_walk($device, 'xupsInputNumPhases', '-OsqnU', 'XUPS-MIB'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
// XUPS-MIB::xupsInputVoltage.1 = INTEGER: 228
|
||||
$volt_oid = ".1.3.6.1.4.1.534.1.3.4.1.2.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$current = (snmp_get($device, $volt_oid, '-Oqv') / $divisor);
|
||||
$index = '3.4.1.2.'.$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
// XUPS-MIB::xupsOutputNumPhases.0 = INTEGER: 1
|
||||
$oids = trim(snmp_walk($device, 'xupsOutputNumPhases', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
// XUPS-MIB::xupsOutputVoltage.1 = INTEGER: 228
|
||||
$volt_oid = ".1.3.6.1.4.1.534.1.4.4.1.2.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$current = (snmp_get($device, $volt_oid, '-Oqv') / $divisor);
|
||||
$index = '4.4.1.2.'.$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
// XUPS-MIB::xupsBypassNumPhases.0 = INTEGER: 1
|
||||
$oids = trim(snmp_walk($device, 'xupsBypassNumPhases', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$volt_oid = ".1.3.6.1.4.1.534.1.5.3.1.2.$i";
|
||||
$descr = 'Bypass';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$current = (snmp_get($device, $volt_oid, '-Oqv') / $divisor);
|
||||
$index = '5.3.1.2.'.$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
@@ -204,6 +204,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('apc', 'apc-embedded-powernet');
|
||||
}
|
||||
|
||||
public function testApcMgeups()
|
||||
{
|
||||
$this->checkOS('apc-mgeups', 'mgeups-galaxy');
|
||||
}
|
||||
|
||||
public function testApic()
|
||||
{
|
||||
$this->checkOS('apic');
|
||||
@@ -633,6 +638,17 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('dsm', 'dsm-ds916');
|
||||
}
|
||||
|
||||
public function testEatonMgeups()
|
||||
{
|
||||
$this->checkOS('eaton-mgeups', 'eaton-5p');
|
||||
$this->checkOS('eaton-mgeups', 'eaton-5px');
|
||||
$this->checkOS('eaton-mgeups', 'mgeups-ex2200');
|
||||
$this->checkOS('eaton-mgeups', 'mgeups-pulsar');
|
||||
$this->checkOS('eaton-mgeups', 'mgeups-evolution');
|
||||
$this->checkOS('eaton-mgeups', 'mgeups-proxy');
|
||||
$this->checkOS('eaton-mgeups', 'mgeups-comet');
|
||||
}
|
||||
|
||||
public function testEatonpdu()
|
||||
{
|
||||
$this->checkOS('eatonpdu');
|
||||
@@ -641,8 +657,6 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
public function testEatonups()
|
||||
{
|
||||
$this->checkOS('eatonups');
|
||||
$this->checkOS('eatonups', 'eaton-5p');
|
||||
$this->checkOS('eatonups', 'eaton-5px');
|
||||
$this->checkOS('eatonups', 'eaton-powerxpert');
|
||||
}
|
||||
|
||||
@@ -1171,16 +1185,6 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('mgepdu');
|
||||
}
|
||||
|
||||
public function testMgeups()
|
||||
{
|
||||
$this->checkOS('mgeups', 'mgeups-pulsar');
|
||||
$this->checkOS('mgeups', 'mgeups-galaxy');
|
||||
$this->checkOS('mgeups', 'mgeups-evolution');
|
||||
$this->checkOS('mgeups', 'mgeups-ex2200');
|
||||
$this->checkOS('mgeups', 'mgeups-proxy');
|
||||
$this->checkOS('mgeups', 'mgeups-comet');
|
||||
}
|
||||
|
||||
public function testMicrosemitime()
|
||||
{
|
||||
$this->checkOS('microsemitime');
|
||||
@@ -1474,11 +1478,6 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('powerwalker');
|
||||
}
|
||||
|
||||
public function testPowerware()
|
||||
{
|
||||
$this->checkOS('powerware');
|
||||
}
|
||||
|
||||
public function testPrestige()
|
||||
{
|
||||
$this->checkOS('prestige');
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|MGE Switched PDU
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.705.2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|Evolution Something
|
||||
1.3.6.1.2.1.1.1.0|4|Evolution Something Data guessed
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.705.1.2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|Galaxy Something
|
||||
1.3.6.1.2.1.1.1.0|4|Galaxy 3000 30 kVA
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.705.1.2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|MGE UPS SYSTEMS - Network Management Proxy
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.705.1
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|Pulsar M
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.705.1.2
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.534
|
||||
Reference in New Issue
Block a user