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
311 stars 274 forks source link

[hardware::ups::standard::rfc1628::snmp::plugin] mode "input-lines" does not see an input line failure #4671

Closed Aleksey-Maksimov closed 1 year ago

Aleksey-Maksimov commented 1 year ago

Hello

This is what the plugin output looks like if the UPS is operating normally. Everything is fine here:

# ./centreon_plugins.pl '--plugin=hardware::ups::standard::rfc1628::snmp::plugin' '--mode=input-lines' '--authpassphrase' 'pwd' '--authprotocol' 'SHA' '--critical-frequence' '49:51' '--critical-voltage' '198:242' '--filter-uom' 'null' '--hostname' 'ups125' '--privpassphrase' 'pwd' '--privprotocol' 'DES' '--snmp-username' 'user1' '--snmp-version' '3' '--use-new-perfdata' --verbose --debug

OK: Input Line '1' Frequence : 49.90 Hz, Voltage : 227.00 V | '1#frequence'=49.9;;49:51;; '1#voltage'=227;;198:242;;
.1.3.6.1.2.1.33.1.3.3.1.2.1 = 499
.1.3.6.1.2.1.33.1.3.3.1.3.1 = 227
.1.3.6.1.2.1.33.1.3.3.1.4.1 = 0
.1.3.6.1.2.1.33.1.3.3.1.5.1 = 0
Input Line '1' Frequence : 49.90 Hz, Voltage : 227.00 V

This is what the plugin output looks like if the incoming voltage to the UPS is lost. It does not change the status from OK to CRITICAL and does not show perfdata:

# ./centreon_plugins.pl '--plugin=hardware::ups::standard::rfc1628::snmp::plugin' '--mode=input-lines' '--authpassphrase' 'pwd' '--authprotocol' 'SHA' '--critical-frequence' '49:51' '--critical-voltage' '198:242' '--filter-uom' 'null' '--hostname' 'ups125' '--privpassphrase' 'pwd' '--privprotocol' 'DES' '--snmp-username' 'user1' '--snmp-version' '3' '--use-new-perfdata' --verbose --debug
OK:
.1.3.6.1.2.1.33.1.3.3.1.2.1 = 0
.1.3.6.1.2.1.33.1.3.3.1.3.1 = 0
.1.3.6.1.2.1.33.1.3.3.1.4.1 = 0
.1.3.6.1.2.1.33.1.3.3.1.5.1 = 0
omercier commented 1 year ago

Hi @Aleksey-Maksimov, If I understand correctly, the returned value is zero whether nothing is plugged or no voltage is provided.

I do not see a way to detect if something's wrong with the absence of voltage on extra inputs (since zero can be a normal value), but I propose to raise a critical alert when none of the input lines have electric tension.

E.g.:

Do you agree with this behaviour?

Aleksey-Maksimov commented 1 year ago

Hello @omercier

I don't understand what you mean by "extra inputs". My example uses a single-phase UPS with a single input.

As you can see in my example, the options '--critical-frequence' '49:51' '--critical-voltage' '198:242' are used. But with no voltage at all (both frequence and voltage values are zero) I get incorrect plugin behavior:

1) It doesn't show CRITICAL status 2) It does not return perfdates with "0" values.

omercier commented 1 year ago

Ok, sorry I got it wrong. We'll take this issue soon, it is in our internal bug tracker now.

Aleksey-Maksimov commented 11 months ago

Hello. @omercier

I don't understand. Was the problem solved in the plugin or did you just close the issue?

omercier commented 11 months ago

Hi @Aleksey-Maksimov, I closed the issue but the fix will soon be pushed in a PR.