1. Install the Epel extension source on the client machine
Yum install-y epel-release
2, yum install Nagios and dependency package software
Yum install-y nagios-plugins
Nagios-plugins-all Nrpe Nagios-plugins-nrpe
3, edit Nrpe configuration file Vim/etc/nagios/nrpe.cfg
is modified as follows: (1) allowed_hosts= 127.0.0.1 change to
allowed_hosts=127.0.0.1,192.168.81.131.
Subsequent IP is the service-side IP.
(2) find "dont_blame_nrpe=0"
to "dont_blame_nrpe=1"
4, start client
/etc/init.d/nrpe start
5, server Configuration monitoring client
The Vim/etc/nagios/conf.d/192.168.81.132.cfg
is configured as follows:
define host{
Use Linux-server
host_name 192.168.81.132
Alias 81.132
address 192.168.81.132
}
Define service{
Use Generic-service
host_name 192.168.81.132
service_description check_ping
Check_command check_ping!100.0,20%!200.0,50%
Max_check_ Attempts 5
Normal_check_interval 1
}
Define service{
Use Generic-service
host_name 192.168.81.132
service_description check_ssh
Check_command check_ssh
max_check_attempts 5
Normal_check_interval 1
}
Define service{
Use Generic-service
host_name 192.168.81.132
service_description check_http
Check_ Command Check_http
max_check_attempts 5
Normal_check_interval 1
}
6, service end multiplicity start Nagios service
Services Nagios Restart
2. Edit the Monitoring client configuration file
Vim/etc/nagios/conf/192.168.81.132.cfg
Add the following content:
#监控负载
Define Service{
Use Generic-service
HOST_NAME 192.168.81.132
Service_description Check_load
Check_command Check_nrpe!check_load
Max_check_attempts 5
Normal_check_interval 1
}
#监控
Define Service{
Use Generic-service
HOST_NAME 192.168.81.132
Service_description check_disk_hda1
Check_command check_nrpe!check_hda1
Max_check_attempts 5
Normal_check_interval 1
}
Define Service{
Use Generic-service
HOST_NAME 192.168.81.132
Service_description Check_disk_hda3
Check_command Check_nrpe!check_hda3
Max_check_attempts 5
Normal_check_interval 1
}
3. Client configuration file Nrpe.cfg
Modify the following:
(1) Find check_hda1 change/dev/hda1 to/DEV/SDA1
Add a row
Command[check_hda2]=..../devsda2. With CHECK_HDA1
4. Restart the client Nrpe service:/etc/init.d/nrpe restart
5. Restart service-side Nagios service
Service Nagios Restart
Nagios Client Installation Monitoring