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@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@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

Reply via email to