conditional variable usage (host specific settings)

Rejo Zenger nagios-users at subs.krikkit.nl
Tue Feb 5 18:38:03 CET 2008


Hi there,

Can I add $ARGn$ like variables to service definitions that are loading
other templates? I have this:

 | define service {
 |         use                     svc-ssh
 |         host_name               box.example.net
 |         service_description     ssh
 |         }

This uses the following more generic definitions:

 | define service {
 |         name                            svc-ssh
 |         use                             svc
 |         register                        0
 |         check_command                   check_ssh
 |         }
 | 
 | define command {
 |         command_name    check_ssh
 |         command_line    $USER1$/check_ssh -H $HOSTADDRESS$ 
 |         }

I want to check ssh on $HOSTADDRESS$ for the majority of servers. There
are however a number of exeptions. These servers must be checked on
their secondary IP address.

Now, can I add something to the first "service definition" so I can
specify it *only* if the second IP address must be used? So, in the
third definition, it should be something like "use specific value if
specified, otherwise use $HOSTADDRESS$".

I am aware I can provide variables using $ARG1$ from the second to the
third definition. But can I do the same from the first to the second
definition?

-- 
Rejo Zenger <rejo at zenger.nl> https://rejo.zenger.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080205/0bd917ac/attachment.sig>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
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