Nagios:配置ping时间

时间:2015-03-04 05:04:34

标签: nagios

我正在使用nagios ver。 4.0.8。 我想设置ping时间间隔为10秒,如下所示:

define command{
command_name    check-host-alive
command_line    $USER1$/check_ping -t 10 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}

但不完全(约90秒)。你能帮助我吗? 感谢

1 个答案:

答案 0 :(得分:1)

你正在以错误的方式看待事情。

define command{
command_name    check-host-alive
command_line    $USER1$/check_ping -t 10 -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}

您发布的内容是Nagios命令。 ' -t 10'不是间隔,而是超时参数。这意味着如果check_ping在10秒内没有得到结果,则该命令将超时。

要定义检查间隔,您需要查看主机(或服务)配置文件。

例如:

define host {
host_name           bogus-router
alias               Bogus Router #1
address             192.168.1.254
parents             server-backbone
check_command           check-host-alive
check_interval          5
retry_interval          1
max_check_attempts      5
check_period            24x7
process_perf_data       0
retain_nonstatus_information    0
contact_groups          router-admins
notification_interval       30
notification_period     24x7
notification_options        d,u,r
}

此示例中的检查间隔为5分钟(check_interval)。使用Nagios不可能设置不到一分钟的间隔。如果您想要更精细(免费)监控,请查看InfluxDB,Telegraf和Grafana。