Install and configure Nagios in nagios 3.0

Source: Internet
Author: User

Install the nagios plugin

 
 
  1. tar zxvf nagios-plugins-1.4.11.tar.gz  
  2.  
  3. cd nagios-plugins-1.4.11  
  4.  
  5. ./configure--prefix=/usr/local/nagios --enable-redhat-pthread-workaround  
  6.  
  7. make all  
  8.  
  9. 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 !) :

 
 
  1. Tar zxvf nrpe-2.8.1.tar.gz
  2.  
  3. Cd nrpe-2.8.1
  4.  
  5. ./Configure-prefix =/usr/local/nagios [./configure -- enable-ssl -- enable-command-args]
  6.  
  7. Make all (Compilation)
  8.  
  9. Make install-plugin install plug-in)
  10.  
  11. Make install-daemon install nrpe daemon)
  12.  
  13. Make install-daemon-config install the configuration file)
  14.  
  15. Make install-xinetd install the xinetd script file)
  16.  
  17. Add the nrpe service to xinetd:
  18.  
  19. Vi/etc/services
  20.  
  21. Nrpe 5666/tcp # nrpe
  22.  
  23. Restart the Xinetd service:
  24.  
  25. Service xinetd restart
  26.  
  27. Test whether Nrpe works properly:
  28.  
  29. /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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.