passing command line parameters to plugins

Jason Qualkenbush jqualkenbush at iso-ne.com
Wed Jun 15 19:44:13 CEST 2005


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?

So just edit the check_command file.  Copy the http check that looks
like this:

# 'check_http' command definition
define command{
        command_name    check_http
        command_line    $USER1$/check_http -H $HOSTADDRESS$
        }

and at the end of the file just create your own version (or just edit
the default).  Like this:

# 'my_check_http' command definition
define command{
        command_name    my_check_http
        command_line    $USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$
        }

Now you can use a check command like "my_check_http!2584".



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