nagios 监控 java进程,Nagios使用check_ping监控主机

我已经通过EPEL存储库在全新安装的CentOS 7上部署了一个新的Nagios实例 . 所以Nagios Core版本是3.5.1 .

在安装了nagios和nagios-plugins-all(通过yum)之后,我创建了许多主机和服务定义,用 nagios -v /etc/nagios/nagios.cfg 测试了我的配置,并启动并运行了Nagios!

不幸的是,我的主机检查失败了(尽管我的服务检查工作正常) .

在Nagios Web GUI / Dashboard中,如果我深入查看具有“主机状态信息”的主机页面,我会看到报告“状态信息”(已删除IP地址):

状态信息:/ usr / bin / ping -n -U -w 30 -c 5 CRITICAL - 无法解释ping命令的输出

41f7f5fe-b1f9-4190-a600-5f7cd1f5e93e.png

因此,在我的故障排除中,我深入了解Nagios插件目录(/ usr / lib64 / nagios / plugins),并使用check_ping插件运行测试,该插件与check-host-alive运行命令的方式一致(请参阅下面的检查) -host-alive命令定义):

./check_ping -H {my-ip-address} -w 3000.0,80% -c 5000.0,100% -p 5

此check_ping命令返回以下输出:

PING OK - 数据包丢失= 0%,RTA = 0.63 ms | rta = 0.627000ms; 3000.000000; 5000.000000; 0.000000 pl = 0%; 80; 100; 0

我没有改变check_ping如何工作的定义,并且只要命令的运行方式与check-host-alive运行命令一样,我就可以确认我得到了“PING OK”,所以我无法弄清楚是什么上!

以下是check-host-alive和check_ping的命令定义 .

# 'check-host-alive' command definition

define command{

command_name check-host-alive

command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5

}

{snip}

# 'check_ping' command definition

define command{

command_name check_ping

command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5

}

有关如何修复check-host-alive命令定义以正常工作并正确评估check_ping输出的任何建议?

Edit

以下是我正在使用的完整定义主机{}模板:

define host {

host_name myers ; The name of this host template

alias Myers

address [redacted]

check_command check-host-alive

contact_groups admins

notifications_enabled 0 ; 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

notification_period 24x7 ; Send host notifications at any time

register 1

max_check_attempts 2

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值