Nrpe is based on the correct installation of Nagios-plugins, nagios-plugins installation details, please go to:
[Nagios monitoring Nagios-plugins installation]http://4709096.blog.51cto.com/4699096/1702224
1. Dependency packet Detection
#rpm-Q xinetd openssl-devel
#yum Install xinetd Openssl-devel
2. Compiling the installation
Nrpe relies on nagios-plugins, so it needs to be installed first.
# TAR-ZXVF Nrpe-2.12.tar.gz
# CD Nrpe-2.12.tar.gz
#./configure \
--prefix=/usr/local/nagios \
--with-nrpe-user=nagios \
--with-nrpe-group=nagios \
--with-nagios-user=nagios \
--with-nagios-group=nagios \
--enable-command-args \
--enable-ssl
# make All
# Make Install-plugin
(The monitor side only installs this one plug-in Can)
3. Configuring monitoring
3.1 Defining Nrpe monitoring commands
#vim/usr/local/nagios/etc/objects/commands.cfg
Add the following on the last side:
# ' Check_nrpe ' command definition
Define Command{
# define command name Check_nrpe, use this name in Services.cfg
Command_name Check_nrpe
#这是定义实际运行的插件程序
Command_line $USER 1$/check_nrpe-h $HOSTADDRESS $-C $ARG 1$
}
Note: This command line is written in exactly the same way as the Check_nrpe command, and you do not know how to use check_nrpe–h to see it.
3.2 Defining monitored host information
#vim/usr/local/nagios/etc/objects/hosts.cfg
Define Host{
#引用主机linux-server Property Information, the Linux-server host is defined in the Templates.cfg file.
Use Linux-server
HOST_NAME nagios-linux #主机名
Alias Nagios-linux #主机别名
#被监控的主机地址, the address can be either IP or a domain name.
Address 192.168.1.111
}
#定义一个主机组
Define Hostgroup{
Hostgroup_name bsmart-servers #主机组名称, can be arbitrarily specified
Alias Bsmart servers #主机组别名
#主机组成员, where "Nagios-linux" is the host defined above
Members Nagios-linux
}
3.3 Defined on the monitored host to monitor service information
#vim/usr/local/nagios/etc/objects/services.cfg
Such as: Monitoring the Load
Define Service{
#引用主机local-service Property Information, Local-service is defined in the Templates.cfg file.
Use Local-service
HOST_NAME nagios-linux #在hosts. COF defined in the host
Service_description Current Load
defined in #check_load要在被监控主机的nrpe. CFG, this command is available by default
Check_command Check_nrpe!check_load
}
Such as: monitoring disk (note to monitor the type and device number of the disk)
Define Service{
Use Local-service
HOST_NAME Nagios-linux
Service_description Check Disk sda1
Check_command Check_nrpe!check_sda3
}
Acknowledgement: I refer to a number of articles after summing up, in this thank you network share!
This article is from the "4699096" blog, please be sure to keep this source http://4709096.blog.51cto.com/4699096/1702254
Nrpe installation of Nagios monitoring (monitor host side)