发布: 2009-2-23 18:38 | 作者: 田逸 | 来源: 测试时代采编 | 查看: 2373次 | 进入软件测试论坛讨论
define contactgroup {
contactgroup_name sagroup //不要用空格
alias system administrator group
members sa,sery //本例有2个成员
} |
#define monitor host
############################################
# Wangjing IDC servers #
############################################
define host {
host_name nagios-server
alias nagios server
address 61.x..x.49
contact_groups sagroup //多个联系组用逗号分隔,数据来源于contactgroups.cfg
check_command check-host-alive
max_check_attempts 5
notification_interval 10 //值可调,大小什么值合适需自己测定
notification_period 24x7
notification_options d,u,r
}
define host {
host_name 24-25
alias server 24-25
address 202.X.24.25
contact_groups sagroup
check_command check-host-alive //down机就发报警通知
max_check_attempts 5
notification_interval 10
notification_period 24x7
notification_options d,u,r
} |
#service definition
###########################################
# Wangjing IDC servers service for host-live #
###########################################
define service {
host_name nagios-server //来源:hosts.cfg
service_description check-host-alive
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup //来源:contactgroups.cfg
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check-host-alive //检查主机是否存活
}
define service {
host_name 74-210
service_description check_tcp 80
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_tcp!80 //检查tcp 80端口服务是否正常
} |