mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
fix: APC/MGE UPS sensors divisor for load and voltage (#6509)
* fix: APCMGE sensors divisors * Add missing SNMP SIM file * Add OS test for snmprec file
This commit is contained in:
parent
8c1fa92c33
commit
2aa4145a26
@ -947,6 +947,12 @@ function get_device_divisor($device, $os_version, $sensor_type, $oid)
|
||||
} elseif ($sensor_type == 'voltage' && !starts_with($oid, '.1.3.6.1.2.1.33.1.2.5.')) {
|
||||
return 1;
|
||||
}
|
||||
} elseif ($device['os'] == 'apc-mgeups') {
|
||||
if ($sensor_type == 'load') {
|
||||
return 1;
|
||||
} elseif ($sensor_type == 'voltage' && !starts_with($oid, '.1.3.6.1.2.1.33.1.2.5.')) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 10; //default
|
||||
|
@ -206,6 +206,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testApcMgeups()
|
||||
{
|
||||
$this->checkOS('apc-mgeups');
|
||||
$this->checkOS('apc-mgeups', 'mgeups-galaxy');
|
||||
}
|
||||
|
||||
|
2
tests/snmpsim/apc-mgeups.snmprec
Normal file
2
tests/snmpsim/apc-mgeups.snmprec
Normal file
@ -0,0 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|GALAXY 5000 30 kVA
|
||||
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.705.1.2
|
Loading…
Reference in New Issue
Block a user