Configuring Nagios
In this chapter, you will learn about other ways in which the Nagios status can be checked as well as how Nagios itself can be managed.
Nagios configuration is stored in a separate directory. Usually it's either in /etc/nagios
or /usr/local/etc/nagios
. If you have followed the steps for manual installation, it will be in the /etc/nagios
directory.
The default installation creates a sample host called localhost and a few services. We will now create additional hosts and services, and create a more robust directory structure to manage all of the objects.
The main Nagios configuration file is called nagios.cfg
, and it's the main file that is loaded during Nagios startup.
Its syntax is simple, a line beginning with #
is a comment, and all lines in the form of <parameter>=<value>
set a value. In some cases, a value might be repeated (such as specifying additional files/directories to read).
The following is a sample of the Nagios main configuration file:
...