第 3 章 Nagios 远程插件执行器安装


作为存储管理员,您可以监控 Ceph 存储集群主机、安装 Nagios 插件、Ceph 插件和 Nagios 远程插件执行程序(NRPE)附加组件。

出于演示目的,本节将 NRPE 添加到带有主机名 host01 的 Ceph Monitor 主机中。在 Nagios 应该监控的所有 Ceph 主机上重复剩余的步骤。

3.1. 安装和配置 Nagios Remote Plug-In Executor

安装 Nagios Remote Plug-in Executor(NPRE),并将其配置为与 Nagios 核心服务器通信。

先决条件

  • 对 Ceph Monitor 主机的 root 级别访问权限。

流程

  1. 在主机上安装这些软件包:

    示例

    [root@host01 ~]# dnf install openssl openssl-devel gcc make git

  2. NRPE 安装需要 Nagios 用户。首先创建用户:

    示例

    [root@host01 ~]# useradd nagios
    [root@host01 ~]# passwd nagios

  3. 下载最新版本的 Nagios 插件。然后,进行并安装它们:

    示例

    [root@host01 ~]# wget http://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
    [root@host01 ~]# tar zxf nagios-plugins-2.3.3.tar.gz
    [root@host01 ~]# cd nagios-plugins-2.3.3
    [root@host01 nagios-plugins-2.3.3]# ./configure
    [root@host01 nagios-plugins-2.3.3]# make
    [root@host01 nagios-plugins-2.3.3]# make install

  4. 下载最新版本的 Ceph 插件:

    示例

    [root@host01 nagios-plugins-2.3.3]# cd ~
    [root@host01 ~]# git clone --recursive https://github.com/ceph/ceph-nagios-plugins.git
    [root@host01 ~]# cd ceph-nagios-plugins
    [root@host01 ceph-nagios-plugins]# make dist
    [root@host01 ceph-nagios-plugins]# make install

  5. 下载、提供和安装 Nagios NRPE:

    示例

    [root@host01 ceph-nagios-plugins]# cd ~
    [root@host01 ~]# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.3/nrpe-4.0.3.tar.gz
    [root@host01 ~]# tar xvfz nrpe-4.0.3.tar.gz
    [root@host01 ~]# cd nrpe-4.0.3
    [root@host01 nrpe-4.0.3]# ./configure
    [root@host01 nrpe-4.0.3]# make all
    [root@host01 nrpe-4.0.3]# make install-groups-users
    [root@host01 nrpe-4.0.3]# make install
    [root@host01 nrpe-4.0.3]# make install-config
    [root@host01 nrpe-4.0.3]# make install-init

  6. 如果使用防火墙,请打开端口 5666,以允许与 NRPE 进行通信:

    示例

    [root@host01 ~]# firewall-cmd --zone=public --add-port=5666/tcp
    [root@host01 ~]# firewall-cmd --zone=public --add-port=5666/tcp --permanent

其它资源

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

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

让开源更具包容性

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

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部