Skip to content

Commit 7a0e0fd

Browse files
authored
Deltaups voltage divisor for Mini-SNMP firmware (librenms#19797)
* device: deltaups voltage divisor for Mini-SNMP firmware Delta UPS602R2RT* base stations with the Mini-SNMP firmware report input / output / bypass voltages in tenths of volts (raw 2302 = 230.2 V) instead of the RFC 1628 whole volts that LibreNMS's stock get_device_divisor() assumes. With the default behaviour the device overview shows "2302 V" for a 230 V mains supply. Verified on UPS602R2RT2N035 with firmware 0F0011BR00.02.03. The older GES602R212035 with the "UPS SNMP Agent" reports correctly so the override is narrowed by hardware string prefix ("Delta UPS602R2RT"). The upsBatteryVoltage OID is excluded from the override because it already uses the RFC 1628 d-1 scale. Adds tests/snmpsim/deltaups_mini-snmp.snmprec and tests/data/ deltaups_mini-snmp.json capturing the affected hardware so a future regression would surface in CI. The existing deltaups and deltaups_rfc1628string fixtures continue to pass (no regression). ./lnms dev:check ci -o deltaups OS detection ✓ OS data is valid: deltaups, deltaups_mini-snmp, deltaups_rfc1628string ✓ OS: deltaups, deltaups_mini-snmp, deltaups_rfc1628string ✓ * device: remove inline comments from deltaups voltage divisor
1 parent eaf1daa commit 7a0e0fd

3 files changed

Lines changed: 691 additions & 0 deletions

File tree

includes/discovery/functions.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ function get_device_divisor($device, $os_version, $sensor_type, $oid)
291291
return 1;
292292
}
293293
}
294+
} elseif ($device['os'] == 'deltaups') {
295+
if ($sensor_type == 'voltage'
296+
&& ! Str::startsWith($oid, '.1.3.6.1.2.1.33.1.2.5.')
297+
&& Str::startsWith($device['hardware'] ?? '', 'Delta UPS602R2RT')) {
298+
return 10;
299+
}
294300
} elseif ($device['os'] == 'huaweiups') {
295301
if ($sensor_type == 'frequency') {
296302
if (Str::startsWith($device['hardware'], 'UPS2000')) {

0 commit comments

Comments
 (0)