Page 1 of 1

Named arguments in a nagios plugin?

Posted: Thu Aug 28, 2014 3:32 pm
by larryq
Hi everyone,

I'm writing my first plugin and am learning about the $ARGx macros. It seems from my reading that you have to supply your plugin with arguments in a particular order? Is there a way to do named parameters instead? I ask because my plugin (a Unix shell script) has a fair number of configuration flags and it would be nice to allow users to pass arguments in the order they want, using the flags they know. Is this possible?

Re: Named arguments in a nagios plugin?

Posted: Thu Aug 28, 2014 3:34 pm
by tmcdonald
Technically you can just use $ARG1$ and cram all the flags into that one arg.

Re: Named arguments in a nagios plugin?

Posted: Thu Aug 28, 2014 3:44 pm
by larryq
tmcdonald wrote:Technically you can just use $ARG1$ and cram all the flags into that one arg.
Works for me, thanks!