In the browser to access Nagios, the refresh will find more than one host, and more than three services. Just don't
After these three services are not what we want, I want to monitor the system load, monitor the disk utilization and other services, this time
To use the Nrpe service. The following continues to add services on the server side.
Edit configuration file on server
# vim/etc/nagios/objects/commands.cfg
Increase:
Define Command{
Command_name Check_nrpe
Command_line $USER 1$/check_nrpe-h $HOSTADDRESS $-C $ARG 1$
}
Note: Define the function parameters of the Check_nrpe
Continue editing
# Vim/etc/nagios/conf.d/192.168.0.12.cfg
Add the following content:
Define Service{
Use Generic-service
HOST_NAME 192.168.1.51
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.1.51
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.1.51
Service_description Check_disk_hda2
Check_command Check_nrpe!check_hda2
Max_check_attempts 5
Normal_check_interval 1
}
Description: "Check_nrpe!check_load" Here the Check_nrpe is just defined in Commands.cfg,
Check_load is a detection script on the remote host.
Edit the Nrpe.cfg configuration file on the remote host
# vim/etc/nagios/nrpe.cfg
Searching for Check_load, this line is the script to execute on the server. Then change the CHECK_HDA1:
/DEV/HDA1 changed to/DEV/SDA1. Add another line Command[check_hda2]=/usr/lib/nagios/plugins/check_disk
-W 20%-C 10%-p/dev/sda2
Restart the Nrpe service on the client
# Service Nrpe Restart
The server also reboots the Nagios service
# Service Nagios Restart
At this point to the browser refresh, you will see more than three services, a little while you can see the specific status
The
After-Class answers:
1. The new define Command{
Command_name Check_nrpe
Command_line $USER 1$/check_nrpe-h $HOSTADDRESS $-C $ARG 1$
}
Do you have a location requirement? Can it be at the end? Or do you have to place it in your video?
A: It's not a problem to write at last.
2.CHECK_NRPE!CHECK_HDA1, between the! What is the meaning? What grammar? Or what is the fixed format?
Check_nrpe is an added command on the server side
CHECK_HDA1 is the command of the client's Day sword
! Clip in the middle don't know what to do
A: It's a fixed format.
1.6-nagios Monitoring Client-2