passing command line parameters to plugins

Arno Lehmann al at its-lehmann.de
Wed Jun 15 19:52:39 CEST 2005


Hello,

Cam wrote:

> Hi,
> 
> I'm trying to use the check_http plugin to check a webserver running
> on an unusual port number.  the syntax at the command line is
> check_http -p <foo> <host>.  to get it working in my services.cfg, i
> just use the literal command-line approach w/ the check_command (e.g.,
> check_command "/usr/lib/nagios/plugins/check_http -p 2584 aspapp1". 
> It seems like the "standard" way is to use the
> "check_http!commandargs" approach, but i'm not sure how that's
> supposed to work w/ the '-p', i've tried "check_http!-p!2584" (w/out
> the quotes), but that doesn't work... what's the syntax for that?

Well, it's documented in the manual and the examples. Basically, you can 
put any macro into in command definition, and $ARG1$ .. $ARGn$ are the 
arguments you give to command in the host or service definition.

So, for example $USER1$/check_http -H $HOSTNAME$ $ARG2$ could be a 
command line definition, that you could use like check_http!-p 2584 from 
a service check.

More details in the distributed docs...

Arno
> Thanks,
> Cameron Matheson
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null

-- 
IT-Service Lehmann                    al at its-lehmann.de
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list