Install the nagios plugin
- tar zxvf nagios-plugins-1.4.11.tar.gz
-
- cd nagios-plugins-1.4.11
-
- ./configure--prefix=/usr/local/nagios --enable-redhat-pthread-workaround
-
- make all
-
- make install
A plug-in is a special program in computer software. It cannot be executed independently but must depend on a software. It can be called in other software environments .)
After the installation is complete, check whether there is a plug-in under libexec:
Ls/usr/local/nagios/libexec/
It is not required to install the Nrpe Service server. We recommend that you install it !) :
- Tar zxvf nrpe-2.8.1.tar.gz
-
- Cd nrpe-2.8.1
-
- ./Configure-prefix =/usr/local/nagios [./configure -- enable-ssl -- enable-command-args]
-
- Make all (Compilation)
-
- Make install-plugin install plug-in)
-
- Make install-daemon install nrpe daemon)
-
- Make install-daemon-config install the configuration file)
-
- Make install-xinetd install the xinetd script file)
-
- Add the nrpe service to xinetd:
-
- Vi/etc/services
-
- Nrpe 5666/tcp # nrpe
-
- Restart the Xinetd service:
-
- Service xinetd restart
-
- Test whether Nrpe works properly:
-
- /Usr/local/nagios/libexec/check_nrpe-H localhost
Daemon:
First, xinetd is a lot of service management programs/etc/services), such as telnet and ftp. If each service has a daemon, it occupies too much resources. Therefore, xinetd is used to listen to ports in a unified manner, and someone uses it to enable the Service. In linux, services that are not used for a long time are not enabled as independent daemon during startup. in linux, all these service listening ports are monitored centrally by an independent process xinetd, after receiving the corresponding client request, the xinetd process starts the corresponding service temporarily and transfers the corresponding port to the corresponding service. After the client is disconnected, the corresponding service process ends and the xinetd continues to listen. After you configure a service as a service monitored by xinetd, you can set whether to start the service on setup, such as nrpe!
All programs ending with d are daemon programs, that is, daemprocess programs. Similarly, xinetd is also a daemon program.
The daemon has two processing modes:
The first one is in the stand alone state, indicating that the program is always listening and running, for example, httpd
The second is super daemon, which is always in sleep state until someone wakes it up. xinetd is a super daemon, but its mission is to transfer a request to other services and be the service manager.
Nagios Configuration
Modify the email address for sending alarm information:
Vi/usr/local/nagios/etc/objects/contacts. cfg
Nagios has a good detection program that can be used to check whether your Nagios configuration is correct:
/Usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios. cfg
Total Warnings: 0
Total Errors: 0
It indicates that your Nagios configuration is correct and can be started properly!
You can start Nagios using the following methods:
/Etc/rc. d/init. d/nagios start/stop/status
Service nagios start/stop/status
/Usr/local/nagios/bin/nagios-d/usr/local/nagios/etc/nagios. cfg
The Nagios configuration and plug-in installation process has been completed. have you learned? We will also introduce:
Modify Apache configuration, monitor Linux server, configure initial Nagios 3.0 installation, and monitor Windows Server and ten Nagios troubleshooting skills. Please read.