Nagios installation (Nrpe installation)

Source: Internet
Author: User

Nagios file directory:

The bin directory is used to store Nagios's execution programs, including Nagios, Nrpe, and so on.

The ETC directory is used to store Nagios configuration files.

The Libexec directory is used to store Nagios's monitoring plug-ins.

The Sbin directory is used to hold the Nagios CGI file, which is the directory where the files needed to execute the external command reside.

The share directory is used to store the Nagios Web page file, which is the directory where the Web pages are stored.

The Include directory is used to hold external calls to the Nagios CGI file.

The Var directory is used to store files such as Nagios log files, lock files, and so on.

Introduction to Nagios Configuration files:

Cgi.cfg the configuration file used to control CGI access.

Htpasswd.users files that are used to hold the Nagios administrator user name and password.

Nagios.cfg is the Nagios master profile, and all CFG profiles (except external calls) must be referenced in this file for the CFG configuration file to take effect.

The resource.cfg variable definition file, also known as a resource file. The variables defined in the file can be referenced by other configuration files, such as $user1$.

Objects is a directory in which files in this directory are primarily used to define Nagios's monitoring objects.

The commands.cfg is a definition file for the Nagios Monitoring command, where the defined commands can be referenced by other configuration files.

Contacts.cfg is a configuration file that defines the contact and contact groups that are notified when the Nagios monitoring object fails.

Localhost.cfg is a configuration file that defines the monitoring local host.

Templates.cfg is a template configuration file that defines hosts and services.

Timeperiods.cfg is a configuration file that defines the time period for nagios monitoring.

Printer.cfg switch.cfg Windows.cfg These three files are templates for monitoring printers, switches, and Windows systems, the configuration files for monitoring Linux hosts need to be created themselves, and the associated files need to be added to the nagios.cfg after they are created

Nrpe's working process:

1. The Nagios monitoring server runs the local Check_nrpe plug-in and tells it which services or resources to check.

2. The Check_nrpe plugin on the Nagios monitoring server will connect to the Nrpe daemon on the remote host.

3. Nrpe daemon on the remote host will run a variety of local nagios plugins to monitor local services or resources.

4. NRPE daemon Returns the result of the check to the Check_nrpe plug-in on the Nagios server, which then sends the results to the Nagios status queue.

5. Nagios reads the information in the queue in turn and displays the results at the end.

Monitored side operation

#yum install-y gcc glibc glibc-common gd gd-devel xinetd openssl-devel cmake make vim C + +

Install the components that will be used later

#useradd nagios-s/sbin/nologin

#tar zxvf nagios-plugins Unzip the Nagios plug-in package

#cd nagios-plugins Get to the folder you just unzipped

#./configure--prefix=/usr/local/nagios Configuring the installation path in/usr/local/nagios

#make && make install to install

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8E/97/wKiom1jGQg-wT-_-AACre6W08do048.png-wh_500x0-wm_ 3-wmp_4-s_2358153218.png "title=" Qq20170313145349.png "alt=" Wkiom1jgqg-wt-_-aacre6w08do048.png-wh_50 "/>

All execution scripts are extracted into the specified folder

#chown-R Nagios.nagios/usr/local/nagios Authorized

#ll/usr/local/nagios

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/8E/97/wKiom1jGQYTh5QXjAAApm3TAEd8413.png "title=" QQ picture 20170313145118.png "alt=" Wkiom1jgqyth5qxjaaapm3taed8413.png "/>

Nrpe official website: https://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/8E/99/wKiom1jGXJeAjcaXAAGs68BXwkA332.png-wh_500x0-wm_ 3-wmp_4-s_1454312075.png "title=" Qq20170313164706.png "alt=" Wkiom1jgxjeajcaxaags68bxwka332.png-wh_50 "/>

Installing Nrpe

Nrpe is part of the XINETD service, so we use xinetd to start Nrpe, listen on 5666 ports

#Tar zxvf Nrpe Decompression Nrpe Compression Pack

#CD Nrpe

#./configure install using the default configuration

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8E/97/wKiom1jGQqTBoimoAAA90HVPkHw614.png-wh_500x0-wm_ 3-wmp_4-s_2689707205.png "title=" Qq20170313145621.png "alt=" Wkiom1jgqqtboimoaaa90hvpkhw614.png-wh_50 "/>

If you report the above error, it proves that the Openssl-devel component is not installed.

#./configure Once you install the Openssl-devel component, you can do it again.

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8E/97/wKiom1jGQwuCJZrdAAA7XdS0V_c180.png-wh_500x0-wm_ 3-wmp_4-s_2667139977.png "title=" Qq20170313145758.png "alt=" Wkiom1jgqwucjzrdaaa7xds0v_c180.png-wh_50 "/>

#make All         

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8E/96/wKioL1jGToHgjC1PAABdo1uZrRM668.png-wh_500x0-wm_ 3-wmp_4-s_3186879537.png "title=" Qq20170313154649.png "alt=" Wkiol1jgtohgjc1paabdo1uzrrm668.png-wh_50 "/>

#make Install-plugin Check_nrpe plug-in installation

#make Install-daemon Nrpe Command File

#make Install-daemon-config Nrpe configuration file

#make install-xinetd Nrpe configuration file based on the xinetd process

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8E/98/wKiom1jGT1zSycTyAACBVDpE8MI826.png-wh_500x0-wm_ 3-wmp_4-s_3012408555.png "title=" Qq20170313155040.png "alt=" Wkiom1jgt1zsyctyaacbvdpe8mi826.png-wh_50 "/>

#vim/etc/xinetd.d/nrpe Modify the configuration file to allow information from the 192.168.1.0 network segment

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8E/96/wKioL1jGUCCwStCkAABD7vPeW0Y460.png-wh_500x0-wm_ 3-wmp_4-s_2114185002.png "title=" Qq20170313155354.png "alt=" Wkiol1jguccwstckaabd7vpew0y460.png-wh_50 "/>

#vim/etc/services Add the following on the last line

Nrpe 5666/tcp # Nrpe

#service xinetd Restart

#netstat-LNTP Service has started, normal listening 5666 port

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8E/97/wKioL1jGWNbzT-w7AABLPXM-7NM438.png-wh_500x0-wm_ 3-wmp_4-s_1644819445.png "title=" qq picture 20170313163103.png "alt=" Wkiol1jgwnbzt-w7aablpxm-7nm438.png-wh_50 "/>

#/usr/local/nagios/libexec/check_nrpe-h 7.0.0.1 If you are prompted for additional questions, check your firewall

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/8E/98/wKiom1jGWVLSAwE5AAAOZKlmIHs361.png-wh_500x0-wm_ 3-wmp_4-s_2451610911.png "title=" Qq20170313163256.png "alt=" Wkiom1jgwvlsawe5aaaozklmihs361.png-wh_50 "/>

The server also needs to install Nrpe, so follow the installation Nrpe section on the server at the end of the execution.

#/usr/local/nagios/libexec/check_nrpe-h 192.168.1.91

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/8E/97/wKioL1jGWzSzxmLWAAANsQHLMy4698.png-wh_500x0-wm_ 3-wmp_4-s_3047445492.png "title=" 13164111.png "alt=" Wkiol1jgwzszxmlwaaansqhlmy4698.png-wh_50 "/>

The Check_nrpe on the Nagios server has been installed properly, and nrpe on the monitored host 192.168.1.91 is already working, and the Nrpe version number is 2.15. This is consistent with the version number we get through the Check_nrpe plugin.

This article is from the "White and Food" blog, please be sure to keep this source http://ls40905250.blog.51cto.com/1270522/1905906

Nagios installation (Nrpe installation)

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.