We've written a nagios plugin using a bash shell script. It works fine, takes a few arguments, and we'd like to allow for optional parameters. I'm not sure a good way to do it however?
The plugin definition looks like this in nagios_command.cfg:
Code: Select all
define command {
command_line /usr/lib/my_shell_script.sh -H $ARG1$ -P $ARG2$ -I $ARG3$ -T $ARG4$ -W $ARG5$
command_name my_nagios_plugin
}
Code: Select all
my_nagios_plugin!a-server-name!9200!/a/server/path!250!150
Is it ok to define $ARG6 and $ARG7 in the define command above and call the plugin like this?
Code: Select all
my_nagios_plugin!a-server-name!9200!/a/server/path!250!150!!
Thanks!