2.9 When Nagios Needs to Do Something: The command Object

Everything that Nagios does is defined in command objects. In the example file supplied, checkcommands.cfg defines a broad range of commands which only need to be included. To do this, you just copy the file to the subdirectory mysite:[37]

nagios@linux:/etc/nagios$ cp objects/checkcommands.cfg \ mysite/checkcommands.cfg

The existing command check_ping illustrates the definition of this object type:

# -- /etc/nagios/mysite/checkcommands.cfg
...
define command{
  command_name check_ping
  command_line $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
-p 5
}
...

check_ping is the name by which the command will later be called when defining a service. commard_line describes the command to be ...

Get Nagios, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.