gpt4 book ai didi

centos - Nagios 处于 OK 或 UP 状态时的重试间隔

转载 作者:行者123 更新时间:2023-12-04 19:34:24 27 4
gpt4 key购买 nike

我使用 NRPE 插件将一台 Linux 主机配置为 Nagios 监控服务器。
为此,我遵循以下 URL

http://www.tecmint.com/how-to-add-linux-host-to-nagios-monitoring-server/

我必须检查 Linux Host 的一些服务。
为了监控 linux 主机和该主机的服务,我使用的是 nagios 日志(/usr/local/nagios/var/nagios.log)

第一次在我的 nagios 日志中显示如下状态

SERVICE ALERT: test.testing.local;Service Tomcat;OK;SOFT;6;TOMCAT OK

当我的服务状态更改为非正常状态时,它会在日志中显示我
SERVICE ALERT: test.testing.local;Service Tomcat;CRITICAL;SOFT;4;TOMCAT CRITICAL

但是我希望如果我的服务状态没有更改为非正常状态,而不是在 1 分钟后再次显示在日志中
SERVICE ALERT: test.testing.local;Service Tomcat;OK;SOFT;6;TOMCAT OK

而目前这还没有发生。

我的 services.cfg 文件内容如下
define service {
host_name test.testing.local
service_description Service Tomcat
check_command check_nrpe!check_service_tomcat
max_check_attempts 10
check_interval 1
retry_interval 1
active_checks_enabled 1
check_period 24x7
register 1
}

我正在使用 Nagios 4.2.2 和 CentOS 7。

最佳答案

我认为您所追求的是来自 Nagios 4 核心文档 here

check_interval: This directive is used to define the number of "time units" between regularly scheduled checks of the host. Unless you've changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.

retry_interval: This directive is used to define the number of "timeunits" to wait before scheduling a re-check of the hosts. Hosts arerescheduled at the retry interval when they have changed to a non-UPstate. Once the host has been retried max_check_attempts times withouta change in its status, it will revert to being scheduled at its"normal" rate as defined by the check_interval value. Unless you'vechanged the interval_length directive from the default value of 60,this number will mean minutes. More information on this value can befound in the check scheduling documentation.


如果您将 check_interval 设置为 1 分钟(这非常频繁,您可以看到默认值为 60),您将 重试每 1 分钟 10 次(您的配置中的 max_check_attempts 次)而不改变状态,那么它会给您一个 OK/UP 状态。

关于centos - Nagios 处于 OK 或 UP 状态时的重试间隔,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41086490/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com