icinga2/itl
Rostislav Opocensky e05128fa3c
pass nwc_health check SNMPv3 args only if needed (#9095)
* pass nwc_health check SNMPv3 args only if needed

check_nwc_health fails if any of the SNMPv3 arguments were passed but
the SNMP version 3 protocol was not requested.

For instance the following works:

	check_nwc_health --hostname 192.0.2.3 --mode cpu-load \
		--protocol 1 --community public

While the following plugin invocation results in an error:

	check_nwc_health --hostname 192.0.2.3 --mode cpu-load \
		--protocol 1 --community public \
		--username joe --authpassword xxx

The superfluous SNMPv3 arguments may easily get inherited e.g. from host
templates.

* string()ify the result of macro() calls

Always convert results of macro("$nwc_health_protocol$") to strings
so both numbers and strings are correctly recognized.

* Revert "string()ify the result of macro() calls"

This reverts commit 3636b5b4ba.

Wrong method applied to the result of macro().

* string()ify the result of macro() calls

Always convert results of macro("$nwc_health_protocol$") in the
set_if clauses of the nwc_health command arguments to strings.
Both numbers and strings are then correctly recognized as the
nwc_health_protocol argument.

* string()ify the result of macro() calls

Always convert results of macro("$nwc_health_protocol$") in the
set_if clauses of the nwc_health command arguments to strings.
Both numbers and strings are then correctly recognized as the
nwc_health_protocol argument.
2021-12-07 15:29:34 +01:00
..
plugins-contrib.d pass nwc_health check SNMPv3 args only if needed (#9095) 2021-12-07 15:29:34 +01:00
CMakeLists.txt Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
command-icinga.conf Implement sleep CheckCommand in memory 2019-05-02 16:24:42 +02:00
command-nscp-local.conf ITL: set globals.NscpPath explicitly 2019-08-27 13:34:10 +02:00
command-plugins-manubulon.conf Merge pull request #8003 from Icinga/feature/snmp-interface-a-7963 2021-03-05 16:11:02 +01:00
command-plugins-windows.conf Change file location, doc, and varaible names as requested in the review 2019-10-18 07:45:21 +02:00
command-plugins.conf Add ITL config option for different NRPE payload size/length 2021-10-12 08:29:07 +02:00
hangman Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
itl Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
manubulon Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
nscp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
plugins Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
plugins-contrib Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
windows-plugins Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00