New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add multiplier option to check_snmp which is available since monitori… #9975
base: master
Are you sure you want to change the base?
add multiplier option to check_snmp which is available since monitori… #9975
Conversation
…ng-plugins v2.3.3, refs Icinga#9907
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the comments below, could you please also document the new options in check_snmp
and check_snmpv3
accordingly. Thanks!
"-M" = { | ||
value = "$snmp_multiplier$" | ||
description = "Multiplies current value, 0 < n < 1 works as divider, defaults to 1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please either use set_if
instead of value
here or set the vars.snmp_multiplier
custom variable at the end of the command definition to its default value (1
), otherwise Icinga 2 may just pass it with an empty string (-M ''
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is how it works, empty variables don't get passed and neither does the key preceeding them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! I just had such a command in my mind /etc/icinga2/scripts/mail-service-notification.sh' '-4' '127.0.0.1' '-6' '::1' '-X' '' '-b' '' '-c' '' '-e' 'hallo' '-l' 'master1' '-n' 'master1' '-o'
, but that doesn't seem to be the case with check commands..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually the same with check commands as well if you explicitly set them to an empty string:
...
vars.snmp_multiplier = ""
results to this: /icinga2/prefix/etc/icinga2/check_snmp' '-M' ''
where set_if
would've omitted it.
@@ -1896,6 +1900,10 @@ object CheckCommand "snmpv3" { | |||
value = "$snmpv3_miblist$" | |||
description = "List of SNMP MIBs for translating OIDs between numeric and textual representation" | |||
} | |||
"-M" = { | |||
value = "$snmpv3_multiplier$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here!
monitoring-plugins added a multiplier option in 2.3.3: https://github.com/monitoring-plugins/monitoring-plugins/releases/tag/v2.3.3
This PR adds the option to the ITL definition for
check_snmp
It Fixes #9907