第 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 级别访问权限。
流程
在主机上安装这些软件包:
示例
[root@host01 ~]# dnf install openssl openssl-devel gcc make gitNRPE 安装需要 Nagios 用户。首先创建用户:
示例
[root@host01 ~]# useradd nagios [root@host01 ~]# passwd nagios下载最新版本的 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下载最新版本的 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下载、提供和安装 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如果使用防火墙,请打开端口
5666,以允许与 NRPE 进行通信:示例
[root@host01 ~]# firewall-cmd --zone=public --add-port=5666/tcp [root@host01 ~]# firewall-cmd --zone=public --add-port=5666/tcp --permanent
其它资源
- 有关 Ceph 的 Nagios 插件的更多信息,请参阅 Ceph 的 Nagios 插件。