<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p>
Quoting Jonathan Angliss <jon@netdork.net>:<br />
<br />
<br />
<br />
> That's not to say you won't see it defined in a service, but less likely<br />
> than a command. What made you think $HOSTNAME$ was valid there? If it<br />
> was valid, what value should it take? What are you trying to achieve?<br />
<br />
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).<br />
<br />
It seems inefficient to be required to define an explicit hostname in each section of an object definition.<br />
<br />
define host{<br />
host_name mymachine<br />
hostgroups MyGroup<br />
alias mymachine<br />
address 10.1.2.100<br />
max_check_attempts 5<br />
contact_groups admins<br />
check_command check-host-alive<br />
}<br />
define service{<br />
use generic-service<br />
host_name %HOSTNAME%<br />
^^^^^^^^ should expand to mymachine<br />
<br />
service_description PING<br />
check_command check_ping!100.0,20%!500.0,60%<br />
}<br />
<br />
<br />
</p>
</body>
</html>