check_disk accepts -w and -c parameters without forcing user to provide threshold values. (#1251)

abrist notifications at github.com
Mon Mar 31 20:03:38 CEST 2014


Isn't this WAI, but maybe not as expected to those unfamiliar with unix
getopt conventions?
I bet if you just specify just one of the options, you will get a usage
error:

[root at localhost nagios-plugins]# ./plugins/check_procs -w
./plugins/check_procs: option requires an argument -- 'w'

If you specify both, if will take the next parameter as the optarg value:

[root at localhost nagios-plugins]# ./plugins/check_procs -w -c
PROCS WARNING: 81 processes | procs=81;-c;;0;

Notice the perfdata setting "-c" as the warning threshold.  I guess some
extra validation could be added to all of the relevant case statements for
the optargs (using some yet to be created functions in utils), but given the
amount of special cases, it will still add a number of lines to every
plugin.

-- 
Reply to this email on GitHub:
https://github.com/monitoring-plugins/monitoring-plugins/issues/1251#issuecomment-39120691
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20140331/7964b9de/attachment.html>


More information about the Devel mailing list