Nagios + Nrpe Configuration Guide

Source: Internet
Author: User
Nagios + Nrpe Configuration Guide 1. preface for system staff, monitoring various running statuses of servers is one of the tasks. for a small number of servers, manual observation is not a problem, but it is too troublesome for server clusters, so many people use some automation tools, such as scripts... nagios + Nrpe Configuration Guide 1. preface for system staff, monitoring various running statuses of servers is one of the tasks. for a small number of servers, manual observation is not a problem, but it is too troublesome for server clusters, so many people use some automation tools, such as scripts. but today we are introducing a very famous open-source project nagios. Nagios is just a monitoring platform. all monitoring tasks are completed by plug-ins, with a high degree of customization and good configuration. NRPE is a popular plug-in, monitors the running status of remote servers, including disk space, CPU load rate, and other customizable content. 2. configure Nagios as a machine on which the nagios platform is installed and accept the information of other monitored servers. Environment: install Centos according to this guide. the installation directory is as follows: installing Nagios and plug-ins to/usr/local/nagios will be configured as the Web interface for monitoring several main services (such as CPU load and disk utilization) of the local system: http://localhost/nagios/ 2.1 make sure that your server is installed: you can run the following command to install yum install httpdyum install gccyum install glibc-commonyum install GD-devel 2.2 to switch between the root user su-l and create a nagios account. logon password/usr/sbin/useradd nagiospasswd nagios creates a user group named nagcmd for WEB interfaces (mainly due to WEB permission issues ). Add both nagios users and apache users to this group. /Usr/sbin/groupadd nagcmd/usr/sbin/usermod-G nagcmd nagios/usr/sbin/usermod-G nagcmd apache 2.3 Download The Nagios installation package mkdir ~ /Downloadscd ~ /Downloads from http://www.nagios.org/download/ Download the latest version, and compile and install cd for nagios and nagios-plugins 2.4 ~ /Downloadstar xzf nagios-** .tar.gz cd nagios -*. /configure -- with-command-group = nagatemake allmake installmake install-initmake install-configmake install-commandmode 2.5 custom configuration editing/usr/local/nagios/etc/objects/contacts. modify the email address in the cfg configuration file, which is the address of the nagios system sending alarm. 2.6 configure the WEB interface to install the nagios WEB configuration file under the conf. d Directory of Apache: make install-webconf to create a nagiosadmin user for logging on to the Nagios WEB interface. Write down the password you entered: htpasswd-c/usr/local/nagios/etc/htpasswd. users nagiosadmin restart Apache service to make the settings take effect service httpd restart2.7 compile and install the Nagios plug-in cd ~ /Downloadstar xzf nagios-plugins-* .tar.gz cd nagios-plugins-* compile and install the plugin. /configure -- with-nagios-user = nagios -- with-nagios-group = nagiosmakemake install2.8 start Nagioschkconfig -- add nagioschkconfig nagios on to verify the Nagios sample configuration file/usr/local/nagios/ bin/nagios-v/usr/local/nagios/etc/nagios. if cfg does not report an error, you can start the Nagios service nagios start 2.9 to change SELiux settings. The red hat series system has SELINUX to enhance security. However, in some cases, this is very troublesome, you need to set up permissions here. if it is too troublesome, you can directly disable SE Linux. If SELinux is in the forced security mode, you need to first get enforce to make SELinux in the allowed mode set enforce 0. However, we recommend that you modify the file force target mode of SELINUX: chcon-R-t httpd_sys_content_t/usr/local/nagios/sbin/chcon-R-t httpd_sys_content_t/usr/local/nagios/share/2.10 login WEB interface now you can log on http://localhost/nagios/ To view the service information of the local machine, enter the username and password you just entered. At this point, the configuration of the nagios 3.0 NRPE plug-in has been basically completed. now the monitoring machine has been configured, but the remote server requires a plug-in to contact the platform. Fortunately, open-source products are comprehensive, there is a ready-made NRPE plug-in that can monitor server disk space problems and CPU load problems in real time, in addition, you can customize the account su-l/usr/sbin/useradd nagiospasswd nagios 3.1 to download the nagios-plugins and nrpe plug-ins. Be sure to download the new version. Tar xzf nagios-plugins-1.4.6.tar.gzcd nagios-plugins-1.4.6. /configuremakemake install chown nagios. nagios/usr/local/nagios chown-R nagios. install xinetd in nagios/usr/local/nagios/libexec 3.3 because nrpe is loaded through the xinetd process, xinetd must be installed. xinetd is not installed in red hat by default. yum install xinetd 3.4 install NRPEtar xzf nrpe-2.8.tar.gzcd. /configuremake all make install-pluginmake install-daemonmake install-daemon-config make ins Tall-xinetd 3.5 edit the nrpe file and edit the/etc/xinetd. d/nrpe file. add the IP addresses of your monitoring platform machines to the backend of the following line and separate them with spaces. Only_from = 127.0.0.1 <你的监控机器ip> Add the nrpe port to the service: Edit the/etc/service file. remember to copy a service file for backup and add this line: nrpe 5666/tcp # NRPE3.6 start the xinetd service. now xinetd can be started to enable the NRPE process to start normally. 3.7 when the verification service is started, we can use netstat-at | grep nrpe to verify whether the process is started. if the process is started normally, the following message is returned: tcp 0 0 *: nrpe *: * The LISTEN command also verifies that the NRPE process function is normal. run the following command to verify that/usr/local/nagios/libexec/check_nrpe-H localhost returns the result: after the NRPE v2.8 3.8 creation command is complete, you need to configure the check_nrpe command. This template is consistent, just copy it: define command {command_name check_nrpecommand_line $ USER1 $/check_nrpe-H $ HOSTADDRESS $-c $ ARG1 $} is used to define the commands for monitoring hosts...
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.