Skip to content

Commit 36ab3eb

Browse files
authored
Merge 9d1b9a9 into 9b8e1c0
2 parents 9b8e1c0 + 9d1b9a9 commit 36ab3eb

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

NEWS.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ https://github.com/networkupstools/nut/milestone/13
8383
* When reconnecting, report success more visibly (not only in debug), and
8484
do not reset driver state to "quiet" when it will loop trying. [PR #3423]
8585

86+
- `snmp-ups` driver updates:
87+
* Extended the `xppc` subdriver (XPPC-MIB, enterprise 935) to expose
88+
`battery.runtime`, `battery.voltage`, `input.frequency`,
89+
`output.voltage.nominal` and `ups.firmware.aux` from Phoenixtec
90+
based UPS cards that already answer the rest of the subtree. [#2608]
91+
8692
- common code:
8793
* Revised 'dstate' machinery to track socket connections closed mid-way
8894
through a call, to avoid access after `free()`. [#3302]

drivers/xppc-mib.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "xppc-mib.h"
2626

27-
#define XPPC_MIB_VERSION "0.40"
27+
#define XPPC_MIB_VERSION "0.41"
2828

2929
#define XPPC_SYSOID ".1.3.6.1.4.1.935"
3030

@@ -109,14 +109,22 @@ static snmp_info_t xppc_mib[] = {
109109

110110
/* upsBaseIdentModel.0 = STRING: "Intelligent" */
111111
snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.1.1.1.0", "Generic Phoenixtec SNMP device", SU_FLAG_OK, NULL),
112+
/* upsSmartIdentAgentFirmwareRevision.0 = STRING: "11105200-1.44.00" */
113+
snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.1.2.4.0", NULL, SU_FLAG_OK, NULL),
112114
/* upsBaseBatteryStatus.0 = INTEGER: batteryNormal(2) */
113115
snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.2.1.1.0", "", SU_STATUS_BATT | SU_TYPE_INT | SU_FLAG_OK, xpcc_onbatt_info),
114116
/* upsSmartBatteryCapacity.0 = INTEGER: 100 */
115117
snmp_info_default("battery.charge", 0, 1, ".1.3.6.1.4.1.935.1.1.1.2.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
118+
/* upsSmartBatteryVoltage.0 = INTEGER: 809 */
119+
snmp_info_default("battery.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.2.2.2.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
116120
/* upsSmartBatteryTemperature.0 = INTEGER: 260 */
117121
snmp_info_default("ups.temperature", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.2.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
122+
/* upsSmartBatteryRunTimeRemaining.0 = INTEGER: 4800 */
123+
snmp_info_default("battery.runtime", 0, 1.0, ".1.3.6.1.4.1.935.1.1.1.2.2.4.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
118124
/* upsSmartInputLineVoltage.0 = INTEGER: 1998 */
119125
snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.3.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
126+
/* upsSmartInputFrequency.0 = INTEGER: 499 */
127+
snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.3.2.4.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
120128
/* upsBaseOutputStatus.0 = INTEGER: onLine(2) */
121129
snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.4.1.1.0", "", SU_TYPE_INT | SU_STATUS_PWR, xpcc_power_info),
122130
/* upsSmartOutputVoltage.0 = INTEGER: 2309 */
@@ -125,6 +133,8 @@ static snmp_info_t xppc_mib[] = {
125133
snmp_info_default("output.frequency", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.4.2.2.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
126134
/* upsSmartOutputLoad.0 = INTEGER: 7 */
127135
snmp_info_default("ups.load", 0, 1, ".1.3.6.1.4.1.935.1.1.1.4.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
136+
/* upsSmartConfigRatedOutputVoltage.0 = INTEGER: 2200 */
137+
snmp_info_default("output.voltage.nominal", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.5.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL),
128138

129139
/* end of structure. */
130140
snmp_info_sentinel

0 commit comments

Comments
 (0)