AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 707952
Accepted
Oliver Salzburg
Oliver Salzburg
Asked: 2015-07-24 06:12:58 +0800 CST2015-07-24 06:12:58 +0800 CST 2015-07-24 06:12:58 +0800 CST

为什么我的被动支票没有得到处理?

  • 772

我有以下服务配置来捕获 SNMP 陷阱:

define service {
    name                            SNMP_TRAP
    service_description             SNMP_TRAP
    active_checks_enabled           1       ; Active service checks are enabled
    passive_checks_enabled          1       ; Passive service checks are enabled/accepted
    parallelize_check               1       ; Active service checks should be parallelized
    process_perf_data               0
    obsess_over_service             0       ; We should obsess over this service (if necessary)
    check_freshness                 0       ; Default is to NOT check service 'freshness'
    notifications_enabled           1       ; Service notifications are enabled
    event_handler_enabled           1       ; Service event handler is enabled
    flap_detection_enabled          1       ; Flap detection 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
    check_command                   check-host-alive      ; This will be used to reset the service to "OK"
    is_volatile                     1
    check_period                    24x7
    max_check_attempts              1
    normal_check_interval           1
    retry_check_interval            1
    notification_interval           120
    notification_period             24x7
    notification_options            w,u,c,r
    contact_groups                  admins
    register                        0
}

define service {
    use                     SNMP_TRAP
    service_description     gigabitethernet16
    hostgroup_name          cisco
    check_interval          120
}

我在cisco组中有几个设备,例如:

define host {
    use                     base-host
    host_name               cisco-sg300-28-4
    alias                   CISCO-SG300-28 (VT-Registratur)
    display_name            Switch VT-Registratur
    address                 10.0.1.109
    hostgroups              switches,cisco,cisco28
}

该服务在 Web 界面中显示得很好:

在此处输入图像描述

但是,根本不处理收到的服务检查。我的/var/lib/nagios3/rw/nagios.cmd文件收集了结果,但该文件永远不会被清除,结果也不会出现在 Nagios 中。nagios.cmd包含,例如:

[1437659629] PROCESS_SERVICE_CHECK_RESULT;cisco-sg300-28-4;gigabitethernet16;2;gigabitethernet16 linkDown

accept_passive_service_checks在 中启用nagios.cfg。

经过进一步检查,我意识到这应该nagios.cmd是一个命名管道。就我而言,它只是一个普通的旧文件:

在此处输入图像描述

从我们的日志存档中,我可以看到被动检查在过去的某个时间被处理过,但现在它们不再起作用了。

nagios
  • 1 1 个回答
  • 996 Views

1 个回答

  • Voted
  1. Best Answer
    Oliver Salzburg
    2015-07-25T00:37:03+08:002015-07-25T00:37:03+08:00

    我再次查看配置以查找更多详细信息nagios.cmd并发现:

    # EXTERNAL COMMAND FILE
    # This is the file that Nagios checks for external command requests.
    # It is also where the command CGI will write commands that are submitted
    # by users, so it must be writeable by the user that the web server
    # is running as (usually 'nobody').  Permissions should be set at the
    # directory level instead of on the file, as the file is deleted every
    # time its contents are processed.
    # Debian Users: In case you didn't read README.Debian yet, _NOW_ is the
    # time to do it.
    
    command_file=/var/lib/nagios3/rw/nagios.cmd
    

    所以,这给了我看的想法README.Debian,它位于/usr/share/doc/nagios3-common/README.Debian并包含以下指令:

    - activate external command checks in the nagios configuration. this
      can be done by setting check_external_commands=1 in the file
      /etc/nagios3/nagios.cfg.
    

    虽然我确定该指令已启用,但我仔细检查了它实际上并未启用。

    在启用它(并执行 中提到的其他任务后README,创建了命名管道。

    • 1

相关问题

  • 使用 Nagios 监视 Novell 集群服务

  • 异地nagios?[关闭]

  • 是否有任何可用的图形工具来为主机生成 nagios 用户提供的地图坐标?

  • 我如何开始使用 Nagios?

  • 如何为 Exchange 邮件存储配置 Nagios 警报

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve