command line parameters in service definitions

Marc Powell marc at ena.com
Fri Dec 5 21:11:25 CET 2008


On Dec 5, 2008, at 1:57 PM, Alan McKay wrote:

> OK folks, I've been working on some of the suggested improvements for
> my check_iflocal plugin, and I cannot seem to get command line
> parameters going into the script from my service definition.
>
> When I run the below from the BASH command line it works as I would
> expect.   But as my service definition it is not working.   It does
> not seems as though the WANTDUPLEX and WANTAUTONEG parameters are
> getting into my script.  Yes, I restarted nagios after updating the
> service definition.
>
> Any thoughts here?
>
> define service{
>        use                     local-service
>        host_name               localhost
>        service_groups          Interfaces
>        contact_groups          admins
>        service_description     eth0
>        check_command
> check_iflocal!eth0!WANTDUPLEX=half!WANTAUTONEG=on
>        }

You'll need to post the check_iflocal command{} definition. That's  
what determines how the command line is created. It should use the  
$ARG1$, $ARG2$ and $ARG3$ macros in the appropriate places for the  
substitution you're expecting.

Better yet, read Example 2 of http://nagios.sourceforge.net/docs/3_0/macros.html

--
Marc


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
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