Cover 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

O'Reilly logo

Appendix D. Macros

Macros are the salt in the Nagios soup, for without them each service would have to be defined individually for each host and each command defined separately for each host and each service. They are identified by the dollar signs surrounding them: $macro$. We will look at the definition of a command with the plugin check_http (see 6.4.2 Web server control via HTTP, page 119):

define command{
   command_name check_http
   command_line $USER1$/check_http -H $HOSTADDRESS$ $ARG1$
}

The definition contains three different macros: the user macro $USER1$, defined in the file resource.cfg (see 2.14 The Resources File resource.cfg, page 79), as well as $HOSTADDRESS$ and $ARG1$. The 32 possible user macros $USER1$ to $USER32$ are like constants ...

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