【问题标题】:Nagios + MK Livestatus + portNagios + MK Livestatus + 端口
【发布时间】:2014-01-31 11:13:31
【问题描述】:

我已经安装了 nagios 和 mk live status,nagios 工作正常,我正在尝试用这个命令测试 mklive status:

nc -v 127.0.0.1 6557 < nagios_query_file 

nagios_query_file 具有该内容:

GET hosts
Filter: name ~~ root
Filter: state = 0
OutputFormat: python

输出是:

nc: connect to 127.0.0.1 port 6557 (tcp) failed: Connection refused

我该怎么办?

【问题讨论】:

    标签: python iptables nagios


    【解决方案1】:

    您的端口似乎没有打开。 只需确保您已在 xinetd 上配置 Livestatus。

    • 安装 xinetd
    • 使用以下内容创建 /etc/xinetd.d/livestatus

    _

    service livestatus
    {
            type            = UNLISTED
            port            = 6557
            socket_type     = stream
            protocol        = tcp
            wait            = no
            cps             = 100 3
            instances       = 500
            per_source      = 250
            flags           = NODELAY
            user            = nagios
            server          = /usr/bin/unixcat
            server_args     = /var/lib/nagios/rw/live
    #       only_from       = 127.0.0.1 192.168.0.0
            disable         = no
    }
    

    查看Remote access to Livestatus via SSH or xinetd了解详细示例

    • 重启xinetd服务

    那么你的例子应该可以工作了。

    但这只是当你想通过网络打开你的 livestatus 套接字时(例如,在一个接口上拥有多个分布式 nagios 核心的结果)。

    如果您只是想在本地测试它,请尝试:

    回显“获取主机”| unixcat /var/lib/nagios/rw/live

    /var/lib/nagios/rw/live 是你的 livestatus 套接字

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多