centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
310 stars 273 forks source link

[hardware::ups::standard::rfc1628::snmp::plugin] Add upsTestResultsSummary OID to "alarms" or "battery-status" mode #4375

Closed cedric-vuillemin closed 1 year ago

cedric-vuillemin commented 1 year ago

Hello,

We recently noticed that the following OID was not used in the "alarms" mode: "upsTestResultsSummary" (1.3.6.1.2.1.33.1.7.3). An alert was present on the UPS web interface but not in Centreon.

Description of the OID : 

The results of the current or last UPS diagnostics test performed. The values for donePass(1), doneWarning(2), and doneError(3) indicate that the test completed either successfully, with a warning, or with an error, respectively. The value aborted(4) is returned for tests which are aborted by setting the value of upsTestId to upsTestAbortTestInProgress. Tests which have not yet concluded are indicated by inProgress(5). The value noTestsInitiated(6) indicates that no previous test results are available, such as is the case when no tests have been run since the last reinitialization of the network management subsystem and the system has no provision for non- volatile storage of test results.

Would it be possible to add the OID to trigger alarms in Centreon through the "alarms" or "battery-status" mode?

garnier-quentin commented 1 year ago

The mode alarms doesn't provide an alert ?

cedric-vuillemin commented 1 year ago

It does for other types of alerts, but not for this one.

This was the value of the OID (the UPS had triggered an alert on its web interface, but the services were OK in Centreon): SNMPv2-SMI::mib-2.33.1.7.3.0 = INTEGER: 4

garnier-quentin commented 1 year ago

it's the number of tests. could you provide a snmpwalk of following branch ? snmpwalk -ObentU -v 2c -c public IP .1.3.6.1.2.1.33.1.7 > ups.snmpwalk

cedric-vuillemin commented 1 year ago

Please find the result below.

[centreon-engine@P-SUPOL-4 ~]$ snmpwalk -ObentU -v 1 -c community ups_ip 1.3.6.1.2.1.33.1.7
.1.3.6.1.2.1.33.1.7.3.0 = INTEGER: 4
.1.3.6.1.2.1.33.1.7.4.0 = ""
.1.3.6.1.2.1.33.1.7.5.0 = 171976846
.1.3.6.1.2.1.33.1.7.6.0 = INTEGER: 0
garnier-quentin commented 1 year ago

https://github.com/centreon/centreon-plugins/pull/4556