Nagios NRPE

(0 comments)

软件安装

RPM 方式

下载并安装以下包:

nagios-plugins-1.3.1-10.neteye
nagios-nrpe-2.0-3.rf

源代码方式

安装 nrpe 前必需安装 nagios-plugin,推荐使用和Nagios服务器相同版本的 nagios-plugin 并使用 rpm 方式安装。

下载源代码并执行编译,目前还没有 make install 命令。

tar zxvf nrpe-2.0.tar.gz
cd nrpe-2.0
./configure --prefix=/usr/local/nagios
make all

因为没有 make install 命令,因此只能手工复制文件到相关目录:

cp src/nrpe /usr/sbin
cp src/check_nrpe /usr/lib/nagios/plugin
mkdir /etc/nagios
cp nrpe.cfg /etc/nagios

创建nrpe xinetd配置文件/etc/xinetd.d/nrpe.xinetd,内容如下:

# default: off
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        type            = UNLISTED
        port            = 5666
        socket_type     = stream
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/sbin/nrpe
        server_args     = -c /etc/nagios/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = yes
        only_from       = 127.0.0.1
}

编辑/etc/services文件,添加NRPE端口信息:

nrpe        5666/tcp            # NRPE

服务端

远程主机需要启动服务端来提供 nagios 服务器查询,并且允许 nagios 服务器的 IP 地址访问。修改 /etc/xinetd.d/nrpe 配置文件:

        disable         = no
        only_from       = 127.0.0.1 10.77.0.200
Currently unrated

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required