The following is a sample Nagios configuration file for a small cluster running on AWS with monitoring settings for system load, free disk space and SSH connectivity.
define host {
use important-host
host_name ec2-xxx.us-west-2.compute.amazonaws.com
}
define host {
use important-host
host_name ec2-xxx.us-west-2.compute.amazonaws.com
}
define host {
use important-host
host_name ec2-xxx.us-west-2.compute.amazonaws.com
}
define host {
name important-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,r
contact_groups admins
}
define service {
use generic-service
host_name ec2-xxx.us-west-2.compute.amazonaws.com, ec2-xxx.us-west-2.compute.amazonaws.com, ec2-xxx.us-west-2.compute.amazonaws.com
service_description disk_free
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups sandbox
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_remote_disks
}
define service {
use generic-service
host_name ec2-xxx.us-west-2.compute.amazonaws.com, ec2-xxx.us-west-2.compute.amazonaws.com, ec2-xxx.us-west-2.compute.amazonaws.com
service_description LOAD
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups sandbox
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_remote_load
}
define service {
use generic-service
host_name ec2-xxx.us-west-2.compute.amazonaws.com, ec2-xxx.us-west-2.compute.amazonaws.com, ec2-xxx.us-west-2.compute.amazonaws.com
service_description SSH
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups sandbox
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_ssh
}