Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2042006
  • 博文数量: 354
  • 博客积分: 4955
  • 博客等级: 上校
  • 技术积分: 4579
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-21 11:46
文章分类

全部博文(354)

文章存档

2015年(1)

2013年(4)

2012年(86)

2011年(115)

2010年(67)

2009年(81)

我的朋友

分类: LINUX

2012-03-13 14:04:30

1 定义主机模板

define host {
#模板名称
name etnet
#该模板的父模板
use generic-host
#最大尝试次数
max_check_attempts 3
#正常检测的时间间隔
normal_check_interval 3
#当检测到监控对象不在线时,尝试检测的次数
retry_check_interval 1
#监测的时间段7X24
check_period 24x7
#报警的时间段
notification_period 24x7
#报警的时间间隔,如果是短信报警的换,意思就是说多长时间用短信通知系统管理员一次
notification_interval 60
#当监控对象出现什么样的状态时发短信通知您
notification_options d,r,u,f
#监测命令 check_command check-host-alive
#联系人 contact_groups admins register 0
}
注: Notification_options d ,r,u,f
d 代表当监控对象出现down 是发送通知
r 当监控对象recoveries 时发送通知
f 当主机启动或者停机时发送通知
u 当有unreachable 状态时发送通知
#定义主机组
 define hostgroup{
hostgroup_name mysql alias mysql-group
#该组的成员 members linux141,linux134
}

define host {
#继承etnet模板
use etnet
host_name linux141
alias mysql41
address 192.168.3.141
}

2 定义service 模板

###define service###
define service {
# 定义service的名称
name tomcat
use generic-service
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_period 24x7
notification_interval 60
notification_options w,u,c,f
contact_groups admins
register 0
}
注: notification_options w,u,c,f
C 代表critival 状态时发送通知,同主机模板中代表的含义是相同的
例如
define hostgroup{
hostgroup_name Memcached
alias Memcache
members Memcache137
}
define host {
use etnet
host_name Memcache137
alias linux137
address 192.168.3.137
}
define service{
use tomcat
host_name Memcache137
service_description CPU Load
check_command check_nrpe!check_load
}
注:一般情况先定义监控service 时,是离不开定义host的


阅读(1955) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~