Quoting Jonathan Angliss <[email protected]>:

> That's not to say you won't see it defined in a service, but less likely
> than a command.  What made you think $HOSTNAME$ was valid there? If it
> was valid, what value should it take? What are you trying to achieve?

I would like to define it in the "define host" section as below, and have it 
expanded in the "define service" section right below it (in the same file).

It seems inefficient to be required to define an explicit hostname in each 
section of an object definition.

define host{
host_name               mymachine
hostgroups              MyGroup
alias                   mymachine
address                 10.1.2.100
max_check_attempts      5
contact_groups          admins
check_command           check-host-alive
}
define service{
use generic-service
host_name       %HOSTNAME%
^^^^^^^^ should expand to mymachine

service_description             PING
check_command                   check_ping!100.0,20%!500.0,60%
}
------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to