-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MON-22575] [Plugin] centreon-plugin-Hardware-Ups-Standard-Rfc1628-Sn…
…mp mode input-lines, no perfdata and thresholds when value equal 0 (#4751) Co-authored-by: Lucie Dubrunfaut <ldubrunfaut@CNTR-P-PF3DNAR1>
- Loading branch information
1 parent
dd7f18d
commit a19941e
Showing
7 changed files
with
161 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
*** Settings *** | ||
Documentation Hardware UPS standard SNMP plugin | ||
Library OperatingSystem | ||
Library String | ||
|
||
Test Timeout 120s | ||
|
||
|
||
*** Variables *** | ||
${CENTREON_PLUGINS} ${CURDIR}${/}..${/}..${/}..${/}src${/}centreon_plugins.pl | ||
|
||
${CMD} perl ${CENTREON_PLUGINS} --plugin=hardware::ups::standard::rfc1628::snmp::plugin | ||
|
||
&{ups_standard_test_with_values} | ||
... snmpcommunity=hardware-ups/hardware-ups-standard | ||
... warningpower= | ||
... criticalcurrent= | ||
... warningvoltage= | ||
... warningfrequence= | ||
... excludeid= | ||
... result=OK: All input lines are ok | '1#line.input.frequence.hertz'=49.9Hz;;;; '1#line.input.voltage.volt'=233V;;;; '1#line.input.current.ampere'=0A;;;; '1#line.input.power.watt'=0W;;;; '2#line.input.frequence.hertz'=49.9Hz;;;; '2#line.input.voltage.volt'=234V;;;; '2#line.input.current.ampere'=0A;;;; '2#line.input.power.watt'=0W;;;; '3#line.input.frequence.hertz'=49.9Hz;;;; '3#line.input.voltage.volt'=234V;;;; '3#line.input.current.ampere'=0A;;;; '3#line.input.power.watt'=0W;;;; | ||
&{ups_standard_test_critical_with_null_values} | ||
... snmpcommunity=hardware-ups/hardware-ups-standard_null_val | ||
... warningpower='215:' | ||
... criticalcurrent='@0:214' | ||
... warningvoltage='@0:214' | ||
... warningfrequence='@0:214' | ||
... excludeid= | ||
... result=CRITICAL: Input Line '1' Frequence : 0.00 Hz, Voltage : 0.00 V, Current : 0.00 A, Power : 0.00 W - Input Line '2' Frequence : 0.00 Hz, Voltage : 0.00 V, Current : 0.00 A, Power : 0.00 W - Input Line '3' Frequence : 0.00 Hz, Voltage : 0.00 V, Current : 0.00 A, Power : 0.00 W | '1#line.input.frequence.hertz'=0Hz;@0:214;;; '1#line.input.voltage.volt'=0V;@0:214;;; '1#line.input.current.ampere'=0A;;@0:214;; '1#line.input.power.watt'=0W;215:;;; '2#line.input.frequence.hertz'=0Hz;@0:214;;; '2#line.input.voltage.volt'=0V;@0:214;;; '2#line.input.current.ampere'=0A;;@0:214;; '2#line.input.power.watt'=0W;215:;;; '3#line.input.frequence.hertz'=0Hz;@0:214;;; '3#line.input.voltage.volt'=0V;@0:214;;; '3#line.input.current.ampere'=0A;;@0:214;; '3#line.input.power.watt'=0W;215:;;; | ||
&{ups_standard_test_with_exclude_option_1} | ||
... snmpcommunity=hardware-ups/hardware-ups-standard | ||
... warningpower= | ||
... criticalcurrent= | ||
... warningvoltage= | ||
... warningfrequence= | ||
... excludeid='1,2' | ||
... result=OK: Input Line '3' Frequence : 49.90 Hz, Voltage : 234.00 V, Current : 0.00 A, Power : 0.00 W | '3#line.input.frequence.hertz'=49.9Hz;;;; '3#line.input.voltage.volt'=234V;;;; '3#line.input.current.ampere'=0A;;;; '3#line.input.power.watt'=0W;;;; | ||
&{ups_standard_test_with_exclude_option_2} | ||
... snmpcommunity=hardware-ups/hardware-ups-standard | ||
... warningpower= | ||
... criticalcurrent= | ||
... warningvoltage= | ||
... warningfrequence= | ||
... excludeid='1, 2' | ||
... result=OK: Input Line '3' Frequence : 49.90 Hz, Voltage : 234.00 V, Current : 0.00 A, Power : 0.00 W | '3#line.input.frequence.hertz'=49.9Hz;;;; '3#line.input.voltage.volt'=234V;;;; '3#line.input.current.ampere'=0A;;;; '3#line.input.power.watt'=0W;;;; | ||
&{ups_standard_test_with_exclude_option_3} | ||
... snmpcommunity=hardware-ups/hardware-ups-standard | ||
... warningpower= | ||
... criticalcurrent= | ||
... warningvoltage= | ||
... warningfrequence= | ||
... excludeid='1 ,3' | ||
... result=OK: Input Line '2' Frequence : 49.90 Hz, Voltage : 234.00 V, Current : 0.00 A, Power : 0.00 W | '2#line.input.frequence.hertz'=49.9Hz;;;; '2#line.input.voltage.volt'=234V;;;; '2#line.input.current.ampere'=0A;;;; '2#line.input.power.watt'=0W;;;; | ||
@{ups_standard_tests} | ||
... &{ups_standard_test_with_values} | ||
... &{ups_standard_test_critical_with_null_values} | ||
... &{ups_standard_test_with_exclude_option_1} | ||
... &{ups_standard_test_with_exclude_option_2} | ||
... &{ups_standard_test_with_exclude_option_3} | ||
|
||
|
||
*** Test Cases *** | ||
Hardware UPS Standard SNMP input lines | ||
[Documentation] Hardware UPS standard SNMP input lines | ||
[Tags] hardware UPS snmp | ||
FOR ${ups_standard_test} IN @{ups_standard_tests} | ||
${command} Catenate | ||
... ${CMD} | ||
... --mode=input-lines | ||
... --hostname=127.0.0.1 | ||
... --snmp-version=2c | ||
... --snmp-port=2024 | ||
... --snmp-community=${ups_standard_test.snmpcommunity} | ||
${length} Get Length ${ups_standard_test.warningpower} | ||
IF ${length} > 0 | ||
${command} Catenate ${command} --warning-power=${ups_standard_test.warningpower} | ||
END | ||
${length} Get Length ${ups_standard_test.criticalcurrent} | ||
IF ${length} > 0 | ||
${command} Catenate ${command} --critical-current=${ups_standard_test.criticalcurrent} | ||
END | ||
${length} Get Length ${ups_standard_test.warningvoltage} | ||
IF ${length} > 0 | ||
${command} Catenate ${command} --warning-voltage=${ups_standard_test.warningvoltage} | ||
END | ||
${length} Get Length ${ups_standard_test.warningfrequence} | ||
IF ${length} > 0 | ||
${command} Catenate ${command} --warning-frequence=${ups_standard_test.warningfrequence} | ||
END | ||
${length} Get Length ${ups_standard_test.excludeid} | ||
IF ${length} > 0 | ||
${command} Catenate ${command} --exclude-id=${ups_standard_test.excludeid} | ||
END | ||
${output} Run ${command} | ||
${output} Strip String ${output} | ||
Should Be Equal As Strings | ||
... ${output} | ||
... ${ups_standard_test.result} | ||
... Wrong output result for compliance of ${ups_standard_test.result}{\n}Command output:{\n}${output}{\n}{\n}{\n} | ||
END |
10 changes: 10 additions & 0 deletions
10
tests/resources/snmp/hardware-ups/hardware-ups-socomec.snmpwalk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.2.0 = INTEGER: 500 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.1.1 = INTEGER: 1 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.1.2 = INTEGER: 2 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.1.3 = INTEGER: 3 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.2.1 = INTEGER: 2330 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.2.2 = INTEGER: 2360 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.2.3 = INTEGER: 2360 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.3.1 = INTEGER: 35 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.3.2 = INTEGER: 36 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.3.3 = INTEGER: 36 |
10 changes: 10 additions & 0 deletions
10
tests/resources/snmp/hardware-ups/hardware-ups-socomec_null_val.snmpwalk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.2.0 = INTEGER: 0 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.1.1 = INTEGER: 1 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.1.2 = INTEGER: 2 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.1.3 = INTEGER: 3 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.2.1 = INTEGER: 0 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.2.2 = INTEGER: 0 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.2.3 = INTEGER: 0 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.3.1 = INTEGER: 0 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.3.2 = INTEGER: 0 | ||
.1.3.6.1.4.1.4555.1.1.7.1.3.3.1.3.3 = INTEGER: 0 |
12 changes: 12 additions & 0 deletions
12
tests/resources/snmp/hardware-ups/hardware-ups-standard.snmpwalk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.1.3.6.1.2.1.33.1.3.3.1.2.1 = INTEGER: 499 | ||
.1.3.6.1.2.1.33.1.3.3.1.2.2 = INTEGER: 499 | ||
.1.3.6.1.2.1.33.1.3.3.1.2.3 = INTEGER: 499 | ||
.1.3.6.1.2.1.33.1.3.3.1.3.1 = INTEGER: 233 | ||
.1.3.6.1.2.1.33.1.3.3.1.3.2 = INTEGER: 234 | ||
.1.3.6.1.2.1.33.1.3.3.1.3.3 = INTEGER: 234 | ||
.1.3.6.1.2.1.33.1.3.3.1.4.1 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.4.2 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.4.3 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.5.1 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.5.2 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.5.3 = INTEGER: 0 |
12 changes: 12 additions & 0 deletions
12
tests/resources/snmp/hardware-ups/hardware-ups-standard_null_val.snmpwalk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.1.3.6.1.2.1.33.1.3.3.1.2.1 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.2.2 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.2.3 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.3.1 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.3.2 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.3.3 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.4.1 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.4.2 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.4.3 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.5.1 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.5.2 = INTEGER: 0 | ||
.1.3.6.1.2.1.33.1.3.3.1.5.3 = INTEGER: 0 |