Named arguments in a nagios plugin?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
larryq
Posts: 8
Joined: Thu Aug 28, 2014 3:11 pm

Named arguments in a nagios plugin?

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Named arguments in a nagios plugin?

Post by tmcdonald »

Technically you can just use $ARG1$ and cram all the flags into that one arg.
Former Nagios employee
larryq
Posts: 8
Joined: Thu Aug 28, 2014 3:11 pm

Re: Named arguments in a nagios plugin?

Post by larryq »

tmcdonald wrote:Technically you can just use $ARG1$ and cram all the flags into that one arg.
Works for me, thanks!
Locked