Skip to content

Commit

Permalink
drivers/cyberpower-mib.c, NEWS: extend support to devices which repor…
Browse files Browse the repository at this point in the history
…t the shorter Vendor OID as their sysOID [#1997]

Closes: #1997

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jul 31, 2023
1 parent 2ced48d commit 8e71210
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ as part of https://github.com/networkupstools/nut/issues/1410 solution.
driver [#1716]
* `baytech-mib.c` subdriver: fixed `baytech_outlet_status_info[]` set
of valid outlet status values [#1871]
* `cyberpower-mib.c` subdriver: support devices which report the shorter
Vendor OID as their sysOID, e.g. "CyberPower PowerPanel Personal" [#1997]

- The `bestfortress` driver shutdown handling was fixed to use a non-trivial
default timeout [#1820]
Expand Down
10 changes: 9 additions & 1 deletion drivers/cyberpower-mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@

#include "cyberpower-mib.h"

#define CYBERPOWER_MIB_VERSION "0.52"
#define CYBERPOWER_MIB_VERSION "0.53"
#define CYBERPOWER_OID_MODEL_NAME ".1.3.6.1.4.1.3808.1.1.1.1.1.1.0"

/* CPS-MIB::ups */
#define CYBERPOWER_SYSOID ".1.3.6.1.4.1.3808.1.1.1"

/* Per https://github.com/networkupstools/nut/issues/1997
* some CPS devices offer the shorter vendor OID as sysOID
*/
#define CYBERPOWER_SYSOID2 ".1.3.6.1.4.1.3808"

/* https://www.cyberpowersystems.com/products/software/mib-files/ */
/* Per CPS MIB 2.9 upsBaseOutputStatus OBJECT-TYPE: */
static info_lkp_t cyberpower_power_status[] = {
Expand Down Expand Up @@ -177,3 +182,6 @@ static snmp_info_t cyberpower_mib[] = {

mib2nut_info_t cyberpower = { "cyberpower", CYBERPOWER_MIB_VERSION, NULL,
CYBERPOWER_OID_MODEL_NAME, cyberpower_mib, CYBERPOWER_SYSOID, NULL };

mib2nut_info_t cyberpower2 = { "cyberpower", CYBERPOWER_MIB_VERSION, NULL,
CYBERPOWER_OID_MODEL_NAME, cyberpower_mib, CYBERPOWER_SYSOID2, NULL };
1 change: 1 addition & 0 deletions drivers/cyberpower-mib.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
#include "snmp-ups.h"

extern mib2nut_info_t cyberpower;
extern mib2nut_info_t cyberpower2;

#endif /* CYBERPOWER_MIB_H */
3 changes: 2 additions & 1 deletion drivers/snmp-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ static mib2nut_info_t *mib2nut[] = {
&bestpower, /* This struct comes from : bestpower-mib.c */
&compaq, /* This struct comes from : compaq-mib.c */
&cyberpower, /* This struct comes from : cyberpower-mib.c */
&cyberpower2, /* This struct comes from : cyberpower-mib.c */
&delta_ups, /* This struct comes from : delta_ups-mib.c */
&eaton_ats16_nmc, /* This struct comes from : eaton-ats16-nmc-mib.c */
&eaton_ats16_nm2, /* This struct comes from : eaton-ats16-nm2-mib.c */
Expand Down Expand Up @@ -173,7 +174,7 @@ static const char *mibname;
static const char *mibvers;

#define DRIVER_NAME "Generic SNMP UPS driver"
#define DRIVER_VERSION "1.29"
#define DRIVER_VERSION "1.30"

/* driver description structure */
upsdrv_info_t upsdrv_info = {
Expand Down

0 comments on commit 8e71210

Please sign in to comment.