1, remove the dpkg installed Nrpe
Dpkg-l | grep Nrpe
Dkpg-p Nagios-nrpe-server
2, Ubuntu under nrpe3.2.1 installation
Download nrpe3.2.1 's Source bundle: https://jaist.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.2.1.tar.gz
The Nagios plugin support is required to run Nrpe on the client, and I am downloading nagios-plugins-2.1.2.tar.gz
https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz#_ga=2.34825377.148967917.1508120974-2090824792.1508120974
3, compile and install before installing Libssl-dev xinetd Openssl-devel and so on related packages, such as not installed, please install.
Cases:
Apt-get Install Libssl-dev
4. Create Nagios users and user groups
Useradd-s/sbin/nologin Nagios
5. Unzip the downloaded Nagios plugin
Tar zxvf nagios-plugins-2.1.2.tar.gz
CD nagios-plugins-2.1.2
6. Compile and install the plugin (the default installation path is/usr/local/nagios and will be created automatically if not present)
./configure
Make && make install
7, unzip the downloaded Nrpe 3.2.1 Source Package
Tar zxvf nrpe-3.2.1.tar.gz
8. Compile and install
CD nrpe-3.2.1
./configure
Make all
Make install
9, install Check_nrpe plug-in:
Make Install-plugin
10, Installation Daemon
Make Install-daemon
Nrpe Daemon will run the appropriate Nagios plugin to check the information and return the information to the Check_nrpe plug-in and give it to nagios for processing.
To install the configuration file:
nrpe3.0 Previous version of Make Install-daemon-config,
This parameter is not indicated when executing this command nrpe3.0 or later
[email protected] nrpe-3.2.1]# make Install-daemon-config
Make: * * * No rule to make target ' install-daemon-config '. Stop.
Need to be performed under the nrpe3.2.1 version
[email protected] nrpe-3.2.1]# make Install-config
/usr/bin/install-c-M 775-o nagios-g nagios-d/usr/local/nagios/etc
/usr/bin/install-c-M 644-o nagios-g Nagios sample-config/nrpe.cfg/usr/local/nagios/etc
At this point you can see the installation changes the permissions of the ETC directory, the configuration file copied to the ETC directory
11, install the starting file:
Make install-inetd #install the startup files for inetd, launchd, etc. ";
Make Install-init #install the startup files for Init, SYSTEMD, etc
12, modify the configuration file (the configuration file written to the Nagios server and the need to write to call monitoring script commands, monitoring scripts are placed under Libexec):
Vim/usr/local/nagios/etc/nrpe.cfg
Found in the configuration file
allowed_hosts=127.0.0.1
This line indicates that local access is allowed. Here is the client, need to allow server-side access, we need to add a row below this line
allowed_hosts=10.0.1.210
Set the IP of the Nagios server.
Start the service
Service Start Nrpe
Set boot up
Service Enable Nrpe
Using the Check_nrpe plug-in for testing, our Check_nrpe and other Nagios plugins are installed in the/usr/local/nagios/libexec directory to enter this directory to execute
[Email protected] libexec]#/check_nrpe-h 127.0.0.1
NRPE v3.2.1
You can refer to the relevant blog:
Http://www.cnblogs.com/cornell/p/3818558.html
http://blog.itpub.net/29569333/viewspace-1154196/
http://comic945.lofter.com/post/1ead6bdb_e5ce67f
Http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html
Http://www.cnblogs.com/ilanni/p/4366232.html
nrpe3.2.1 Installation of Nagios client