Nagios Structure Description
Nagios structure, can be divided into core and plug-in two parts. The core of Nagios only provides a little monitoring function, so to build a perfect IT monitoring management system, users also need to install the appropriate plug-ins in the Nagios server, Plug-ins can be downloaded from the Nagios official website http://www.nagios.org/, You can also write the required plug-ins yourself according to the actual requirements.
Nagios functional features that can be implemented
Monitor network Services (SMTP, POP3, HTTP, FTP, PING, etc.);
Monitor the local and remote host resources (CPU load, disk utilization, process, etc.);
Allows users to write their own plug-ins to monitor specific services, easily expand their own service detection methods, support a variety of development languages (Shell, Perl, Python, PHP, etc.)
Have the ability to define the network hierarchy structure, using "parent" host definition to express the relationship between the network host, this relationship can be used to identify and clear host downtime or unreachable state;
Send the alarm to the contact person (via EMail, SMS, User Defined Way) when the service or host problem arises and resolves;
can support and realize redundant monitoring of the host;
The available WEB interface is used to view current network status, notification and fault history, log files, and so on;
Implementation principle of Nagios monitoring
The Nagios software needs to be installed on a separate server, known as the Monitoring Center, where the server can use Linux or Unix operating systems; each monitored hardware host or service runs a Nagios software daemon that communicates with the Monitoring Center server, It can also be understood as an Agent or plug-in. The Monitoring Center server reads the instructions in the configuration file and communicates with the remote daemon, and instructs the remote daemon to perform the necessary checks. Although the Nagios software must be running on Linux or Unix operating systems, the remotely monitored machine can be any host that can communicate with it, depending on the response returned by the remote host, Naigos will respond according to the configuration, and then Nagios will be tested by a local machine, If the detection return value is incorrect, Nagios will alarm in one or more ways, as shown in the following illustration:
Figure 1. Nagios Monitoring principle Diagram
Nagios Installation and Configuration
Nagios Installation
Pre-Installation Preparation
Listing 1. Nagios Pre-Setup operation
# wget http://apt.sw.be/redhat/el6/en/x86_64/RPMS.dag/\
rpmforge-release-0.3.6-1.el6.rf.x86_64.rpm
# RPM--import Http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
# RPM-UVH rpmforge-release-0.3.6-1.el5.rf.x86.rpm
Install related Packages
Listing 2. Installing packages
#yum Install GD fontconfig-devel libjpeg-devel libpng-devel gd-devel perl-gd \
Openssl-devel php mailx postfix cpp gcc gcc-c++ libstdc++ glib2-devel
Libtoul-ltdl-devel
Creating Users and Groups
Listing 3. Creating Users and Groups
#groupadd-G 6000 Nagios
#groupadd-G 6001 Nagcmd
#useradd-u 6000-g nagios-g nagcmd-d/home/nagios-c "Nagios Admin" Nagios
Compile and install Nagios