1.Nrpe Installation
Create Nagios User
Useradd Nagios
1.1 Installed Nagios plugin by the monitor server
Tar xzvfnagios-plugins-1.4.15.tar.gz
CD nagios-plugins-1.4.15
./configure
Make
Make install
1.2 The monitor server installs the Nrpe program
Tar xzvf nrpe-2.1.2.tar.gz
CD nrpe-2.1.2
./configure--prefix=/usr/local/nagios
Make all
Make Install-plugin
Make Install-daemon
Make Install-daemon-config
Check plug-in Installation
ll/usr/local/nagios/libexec/
1.3 Modify the Nrpe configuration file, add the allowed IP
#vi/usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,192.169.0.201
Start Nrpe
#/usr/local/nagios/bin/nrpe-c/usr/local/nagios/etc/nrpe.cfg-d
# netstat-plnt |grep Nrpe
TCP 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 16831/nrpe
1.4 Join the Boot self
Echo '/usr/local/nagios/bin/nrpe-c/usr/local/nagios/etc/nrpe.cfg-d ' >>/etc/rc.local
1.5 Verify that the client Nrpe is installed on the main nagios.
[Root@nagios-server src]#/usr/local/nagios/libexec/check_nrpe-h 192.168.1.100
NRPE v2.12
If the version number appears, the Nrpe client installation succeeds.
2 main Nagios Call Nrpe configuration
2.1 Edit the Nrpe configuration file on the client
#vi/usr/local/nagios/etc/nrpe.cfg
Command[check_users]=/usr/local/nagios/libexec/check_users-w 5-c 10
Command[check_load]=/usr/local/nagios/libexec/check_load-w 15,10,5-c 30,25,20
2.2 Defining the client host on the primary Nagios
#vi/usr/local/nagios/etc/objects/hosts.cfg
Define Host{
Use Linux-server,host-pnp
HOST_NAME HostB
Alias HostB
Address 192.168.1.100
}
2.3 Configuring services on the main Nagios
#vi/usr/local/nagios/etc/objects/services.cfg
Define Service{
Use Generic-service,srv-pnp
HOST_NAME HostB
Service_description check_users
Check_command check_nrpe!check_users
Max_check_attempts 5
Normal_check_interval 1
}
Define Service{
Use Generic-service,srv-pnp
HOST_NAME HostB
Service_description Check_load
Check_command Check_nrpe!check_load
Max_check_attempts 5
Normal_check_interval 1
}
2.4 Restart the main Nagios service
#/etc/init.d/nagios Checkconfig
#/etc/init.d/nagios restart