Hi, <div><br></div><div>I have several webservers that have over 20 (virtual)interfaces each. </div><div><br></div><div>So I've defined the host with custom macros for each private IP:</div><div><br></div><div>define host{</div>
<div> use linux-server</div><div> _ip_private_VIP_1 10.4.200.101</div><div> _ip_private_VIP_2 10.4.201.101</div><div> ...</div><div> }</div><div><br></div><div>Now I want to refer to this $_HOSTip_provate_VIP_1$ macro in services definitions, but nagios is complaining about not finding the service. </div>
<div><br></div><div>The documentation isn't clear whether or not custom macros could be used in service definitions. </div><div><br></div><div>I've a command like this: </div><div><br></div><div>define command{</div>
<div> command_name check_http_str_return_args</div><div> command_line $USER1$/check_http -I $ARG1$ $ARG2$</div><div> }</div><div><br></div><div>And the service definition: </div><div><br></div><div>define service{</div>
<div> use generic-service</div><div> (...)</div><div> check_command check_http_str_return_args!$_HOSTip_private_VIP_1$!-u / -t 10 -w 3 -c 5 -e HTTP/1.1 200 OK</div><div> }</div><div><br></div><div>My question is: </div>
<div><br></div><div>Is it by design that custom macros should NOT be used in service definitions? </div><div><br></div><div>Because I'd need to create ONE COMMAND per VIP just to use custom macros? </div><div><br></div>
<div>I would like to set just one services, to use just ONE command, and be able to check the whole webserver farm. </div><div><br></div><div>Best regards,</div><div>Marcel</div>