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

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 ...

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