Open darkounet opened 7 years ago
👍
Hm, the sytax for negative values is somewhat broken ... problem is when adding a white space, that the leading dash gets interpreted as argment by the getops parser. Unfortunately the plugin guidelines do not specify such edge case ... have an idea? https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT
Can you add an argument to ignore if no process are founds ? ( -p for positive number of process, -i for ignore <1 process, .... )
Thanks
Hm, seems to be a more common getopt problem and should be treated as such.
A good read: https://docstore.mik.ua/orelly/perl/prog/ch07_035.htm
I'm on my ipad now, but I think :s
instead of =s
could be the culprit.
https://github.com/dnsmichi/manubulon-snmp/blob/master/plugins/check_snmp_process.pl#L259 vs https://github.com/lausser/check_mysql_health/blob/master/plugins-scripts/check_mysql_health.pl#L308
Might also be worthwhile to rewrite getopt like in the mysql_health code.
Hi dnsmichi, confirming that changing the getopt style from :s to =s (for the two options I needed, warn and crit) allows for negative low threshold to be passed in:
I'm happy to submit a patch for this, but it's really just trivial changes to lines 249 and 250:
'c:s' => \$o_crit, 'critical:s' => \$o_crit, 'w:s' => \$o_warn, 'warn:s' => \$o_warn,
Hi,
I have an error with check_snmp_process.pl define in icinga2 manubulon plugin, I can't specify warning or critical with negative values like -1,20
ie :
I want to check the number of process for smtp, and this number can be 0
so I run this check :
But icinga run it like :
The problem is the space betwen -c or -w and value, must be -c-1,100 not -c(space)-1,100
Do you know how can I remove this useless space for this two args ?
I'm using the latest version of plugins
Thanks