【问题标题】:Monitor a service running on a port other than 80 in Nagios在 Nagios 中监视在 80 以外的端口上运行的服务
【发布时间】:2016-08-09 10:03:12
【问题描述】:

我们如何使用 Nagios 监控在机器上运行的远程服务。 我创建了一个cfg文件如下:

define command {
        command_name                    check_http
        command_line                    /usr/lib64/nagios/plugins/check_http -H $HOSTADDRESS$ -p 8082
        }

现在当我重新加载配置文件时,它会抛出以下错误:

Warning: Duplicate definition found for command 'check_http' (config file '/etc/nagios/servers/cfbase-prod.cfg', starting on line 19)
Error: Could not add object property in file '/etc/nagios/servers/cfbase-prod.cfg' on line 20.
   Error processing object config files!

我无法弄清楚问题所在。 请帮忙!

【问题讨论】:

    标签: monitoring nagios


    【解决方案1】:

    基本问题是command_name 值与原始/标准check_http 命令冲突。你有(至少)几个选择:

    1. 设置一个唯一的command_name,例如check_http_8082
    2. 定义一个命令来检查作为参数传递的任意端口上的 http。例如。

      define command{
          command_name check_http_port
          command_line /usr/lib64/nagios/plugins/check_http -H $HOSTADDRESS$ -p $ARG1$
      }
      

    【讨论】:

      猜你喜欢
      • 2012-02-12
      • 2023-03-28
      • 1970-01-01
      • 2013-01-27
      • 1970-01-01
      • 2019-09-15
      • 1970-01-01
      • 1970-01-01
      • 2021-09-16
      相关资源
      最近更新 更多