Command Definitions

Steve Bonds r1p6os402 at sneakemail.com
Thu Jan 23 22:20:14 CET 2003


If spaces could be added it would be helpful for using $ARG1$ to contain a
complete optional argument.  For example, in this ficticious example
suppose a plugin has an "--exclude" option that only some hosts
need.  Then with embedded spaces you could use:

command_line    check_service $ARG1$

check_command   check_service!--exclude="exluded thing"

only on the subset of hosts that needed it without having to define a
dedicated command for each possible "--exclude" option.

With that said, I haven't tried this to see if it works.  ;-)

  -- Steve

On Thu, 23 Jan 2003, Jon Lyons jlyons30-at-yahoo.com |Nagios| wrote:

> 
> Why not;
> /usr/local/nagios/libexec/check_http -H $ARG1$ -u $ARG2$
> &
> check_http!www.mydomain.com!testscript.pl 
>  dan at remics.net wrote:
> I don't know if this is already in the archives (Sourceforge's search engine is currently misbehaving), but I need a little help with host & service command definitions. 
> 
> I was wondering, can command argument macros contain spaces? for instance if I have the following: 
> 
> define command{ 
>         command_name                        check_http 
>         command_line                        /usr/local/nagios/libexec/check_http $ARG1$ 
>         } 
> 
> Can I then construct a service definition like this: 
> 
> define service{ 
>         host_name                        host1 
>         service_description                Check Virt Server 
>         check_command                check_http!-H www.mydomain.com -u /testscript.pl 
>         ... 
> 
> I know there doesn't seem like a good reason to do this (and that I should just use multiple macro arguments), but I have my reasons. 
> 
> Thanks. 
> 
> Daniel Koffler
> dan at remics.net
> http://www.remics.net
> Tel: 514.497.1411
> Fax: 206.600.4642
> GPG Key ID: 0xA2C6DC83 Fingerprint: 1FD7 3FDF 8A0D 961F 26A2 3EDA AE8F A874 A2C6 DC83 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list