没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
创建监控脚本
1、在nrpe.cfg文件末尾增加下面几行内容:
# my custom monitor items
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -r -w .15,.10,.05 -c .30,.25,.20
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
command[check_mem]=/usr/local/nagios/libexec/check_mem.pl -w 90% -c 95%
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
2、修改nagios.cfg配置文件
(1)注释掉这行
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
(2)添加下面两行内容
cfg_file=/usr/local/nagios/etc/objects/services.cfg
cfg_file=/usr/local/nagios/etc/objects/hosts.cfg
3、修改检查语法脚本
#vi /etc/init.d/nagios +181
#check_config
$NagiosBin -v $NagiosCfgFile;
4、修改commands.cfg文件,末尾添加以下内容:
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
# 'check_ping' command definition
define command{
command_name check-ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 100.0,20% -c 200.0,50% -p 3 -t 2
}
1、在nrpe.cfg文件末尾增加下面几行内容:
# my custom monitor items
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -r -w .15,.10,.05 -c .30,.25,.20
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
command[check_mem]=/usr/local/nagios/libexec/check_mem.pl -w 90% -c 95%
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
2、修改nagios.cfg配置文件
(1)注释掉这行
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
(2)添加下面两行内容
cfg_file=/usr/local/nagios/etc/objects/services.cfg
cfg_file=/usr/local/nagios/etc/objects/hosts.cfg
3、修改检查语法脚本
#vi /etc/init.d/nagios +181
#check_config
$NagiosBin -v $NagiosCfgFile;
4、修改commands.cfg文件,末尾添加以下内容:
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
# 'check_ping' command definition
define command{
command_name check-ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 100.0,20% -c 200.0,50% -p 3 -t 2
}
# 'check_http' command definition
define command{
command_name check-weburl
command_line $USER1$/check_http -H $HOSTADDRESS$ $ARG1$ -w 5 -c 10
}
# 'check_tcp' command definition
define command{
command_name check-tcp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ -w 0.02 -c 0.1
}
# Define some hosts
###########192.168.1.111##################
define host {
use linux-server
host_name nagios-server
alias nagios-server
address 192.168.1.111
check_command check-host-alive
max_check_attempts 3
normal_check_interval 2
retry_check_interval 2
check_period 24x7
notification_interval 300
notification_period 24x7
notification_options d,u,r
contact_groups admins
剩余5页未读,继续阅读
资源评论
深巷的猫~
- 粉丝: 325
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功