3.3. 配置 Nagios 核心服务器访问远程节点


为了使 Nagios Core 服务器能够访问远程机器上的 Nagios Remote Plugin Executor(NPRE),远程计算机的 xinetd 和 NRPE 配置必须使用 Nagios 核心服务器的 IP 地址更新。

先决条件

  • 用户级访问 Nagios 核心服务器.
  • 互联网访问.
  • 访问 Nagios 远程插件执行器.

流程

  1. 使用 Nagios 服务器的 IP 地址编辑 xinetd 配置:

    [user@mon]# vi /etc/xinetd.d/nrpe
    # default: off
    # description: NRPE (Nagios Remote Plugin Executor)
    service nrpe
    {
        disable         = yes
        socket_type     = stream
        port            = 5666
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
        only_from       = 127.0.0.1,IP_ADDRESS_OF_NAGIOS_CORE_SERVER
        log_on_success  =
    }
  2. 将 Nagios Core 服务器的 IP 地址添加到 only_from 选项后,重启 xinetd 服务:

    [user@mon]# systemctl restart xinetd
  3. 使用 Nagios 服务器的 IP 地址编辑 NRPE 配置:

    [user@mon]# vi /usr/local/nagios/etc/nrpe.cfg
    allowed_hosts=127.0.0.1,IP_ADDRESS_OF_NAGIOS_CORE_SERVER
  4. 将 Nagios Core 服务器的 IP 地址添加到 allowed_hosts 设置。然后,重启 nrpe

    [user@mon]# systemctl restart nrpe
  5. 测试安装:

    [user@host]# /usr/local/nagios/libexec/check_nrpe -H localhost

    该检查应回显 NRPE v3.1.0-rc1 (如果工作正常)。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部