# Asimpleconfigurationfileformonitoringthelocalhost # Thiscanserveasanexampleforconfiguringotherservers; # Customservicesspecifictothishostareadded...
# A simple configuration file for monitoring the local host
# This can serve as an example for logging ing other servers;
# Custom services specific to this host are added here, but services
# Defined in nagios2-common_services.cfg may also apply.
#
######################################## ################
# Define a host
######################################## ################
Define host {
Use generic-host // template used
Host_name localhost // define the host name
Alias localhost // alias
Address 127.0.0.1 // IP address
}
# Define host {
Use generic-host // template used
Host_name ceshi228
Alias ceshi228
Address 221.204.219.228
}
######################################## ################
# Define the service or process to be monitored
######################################## ################
# Check that web services are running
Define service {
Hostgroup_name http-servers
Service_description HTTP
Check_command check_http
Use generic-service
Notification_interval 0; set> 0 if you want to be renotified
}
Define service {
Hostgroup_name http-servers
Service_description Current Load
Check_command check_load
Use generic-service
Notification_interval 0; set> 0 if you want to be renotified
}
Define service {
Hostgroup_name http-servers
Service_description Current Disks
Check_command check_all_disks! 20%! 10%! /
Use generic-service
Notification_interval 0; set> 0 if you want to be renotified
}
Define service {
Hostgroup_name http-servers
Service_description Current Process
Check_command check_procs
Use generic-service
Notification_interval 0; set> 0 if you want to be renotified
}
######################################## ################
# Custom Service and listening port
######################################## ################
# Check that mysql services are running
Define service {
Hostgroup_name mysql-server // host group. many hosts running this service must be placed in this group.
Service_description mysql
Check_command check_tcp! 3306
Use generic-service
Notification_interval 1; set> 0 if you want to be renotified
}
Jaty0817 BLOG