Add Mail Alert address first
Vim/usr/local/nagios/etc/objects/contacts.cfg
Define Contact{
Contact_Name nagiosadmin;
Use Generic-contact;
Alias Nagios Admin;
email [email protected];
}
Just modify this part, the others don't care
Vim /usr/local/nagios/etc/nagios.cfg
Remove cfg_dir=/usr/local/nagios/etc/servers Annotations
mkdir /usr/local/nagios/etc/servers
The directory where you need to monitor the server configuration files, easy to manage
Example: Monitoring the remote 192.168.1.11 host, as well as CPU, memory, hard disk usage, number of processes, and configuration of the zombie process
VI 192.168.1.11.cfg
Define Host{
Use Linux-server
HOST_NAME test
Alias Test_1
Address 192.168.1.1
}
Define Service{
Use Generic-service
HOST_NAME test
Service_description CPU Load
Check_command Check_nrpe!check_load
}
Define Service{
Use Generic-service
HOST_NAME test
Service_description Current Users
Check_command check_nrpe!check_users
}
Define Service{
Use Generic-service
HOST_NAME test
Service_description Disk Free Space
Check_command Check_nrpe!check_root
}
The file name can be customized, but the suffix must be cfg
If you have more than one server, you only need to copy multiple files to modify IP
This article from "People want to have a dream, in case the realization of" blog, please be sure to keep this source http://yangke.blog.51cto.com/9530509/1568524
Server Monitoring-nagios Configuration Chapter