O'Reilly logo

Nagios, 2nd Edition by Wolfgang Barth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

D.2 On-Demand Macros

On-demand macros—which have existed since Nagios 2.0—reference the same contents as standard macros do. The subtle difference between them lies in the context of what they reference. Whereas standard macros refer exclusively to the host, service, or contact object currently being used, on-demand macros enable access to values from any external objects you please:

$HOSTADDRESS:linux01$
$HOSTSTATE:switch05$

The macros are the same as standard macros, but their names include the name of the host to which the reference is made. The colon is used as a separator. For services, the service name also needs to be specified, again separated with another colon:

$SERVICESTATE:switch05:PING$
$SERVICESTATE::NRPE$

If the host field is left empty, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required