资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

安装nrpe客户端-创新互联

安装nrpe客户端:

成都创新互联网站建设公司是一家服务多年做网站建设策划设计制作的公司,为广大用户提供了成都做网站、网站制作,成都网站设计,1元广告,成都做网站选成都创新互联,贴合企业需求,高性价比,满足客户不同层次的需求一站式服务欢迎致电。

[root@svr1 ~]# useradd nagios

[root@svr1 ~]# tar -xzf nagios-plugins-1.4.15.tar.gz

[root@svr1 ~]# cd nagios-plugins-1.4.15

[root@svr1 nagios-plugins-1.4.15]# ./configure

[root@svr1 nagios-plugins-1.4.15]# make && make install

[root@svr1 ~]# tar -xzf nrpe-2.12.tar.gz

[root@svr1 ~]# cd nrpe-2.12

[root@svr1 nrpe-2.12]# ./configure

*** Configuration summary for nrpe 2.12 03-10-2008 ***:

 General Options:

 -------------------------

 NRPE port:   5666

 NRPE user:   nagios

 NRPE group:  nagios

 Nagios user:  nagios

 Nagios group: nagios

[root@svr1 nrpe-2.12]# make all && make install-plugin

cd ./src/ && make install-plugin

make[1]: Entering directory `/root/nrpe-2.12/src'

/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec

/usr/bin/install -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec

make[1]: Leaving directory `/root/nrpe-2.12/src'

[root@svr1 nrpe-2.12]# make install-daemon

cd ./src/ && make install-daemon

make[1]: Entering directory `/root/nrpe-2.12/src'

/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin

/usr/bin/install -c -m 775 -o nagios -g nagios nrpe /usr/local/nagios/bin

make[1]: Leaving directory `/root/nrpe-2.12/src'

[root@svr1 nrpe-2.12]# make install-daemon-config

/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc

/usr/bin/install -c -m 644 -o nagios -g nagios sample-config/nrpe.cfg /usr/local/nagios/etc

[root@svr1 nrpe-2.12]# make install-xinetd

/usr/bin/install -c -m 644 sample-config/nrpe.xinetd /etc/xinetd.d/nrpe

[root@svr1 nrpe-2.12]# vim /etc/xinetd.d/nrpe

# default: on

# description: NRPE (Nagios Remote Plugin Executor)

service nrpe

{

    flags      = REUSE

    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

    log_on_failure  += USERID

    disable     = no

    only_from    = 10.1.1.40

}

[root@svr1 nrpe-2.12]# service xinetd restart

Stopping xinetd: [  OK  ]

Starting xinetd: [  OK  ]

[root@svr1 nrpe-2.12]# chkconfig --list | grep nrpe

    nrpe:      on

[root@svr1 nrpe-2.12]# netstat -tnlp | grep nrpe

tcp     0    0 0.0.0.0:5666         0.0.0.0:*          LISTEN   25360/nrpe

[root@svr1 nrpe-2.12]# vim /usr/local/nagios/etc/nrpe.cfg

修一行:

allowed_hosts=127.0.0.1,10.1.1.40

本机测试!

[root@svr1 nrpe-2.12]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

[root@svr1 nrpe-2.12]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load

OK - load average: 0.00, 0.00, 0.00|load1=0.000;15.000;30.000;0; load5=0.000;10.000;25.000;0;

load15=0.000;5.000;20.000;0;

备注:有时候在客户端本机上测试时,发现会报错。CHECK_NRPE: Error - Could not complete SSL handshake.

这个时候,注意下xinetd.d/nrpe 以及nrpe.conf 里关于allowed相关的选项,另外就是防火墙。

使用xinetd后发现重启xinetd并不能重启nrpe,只有将其 T掉然后再开。

从远程主机上测试下:

[root@svr4 ~]# /usr/local/nagios/libexec/check_nrpe -H 10.1.1.10 -c check_total_procs

PROCS CRITICAL: 249 processes

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章名称:安装nrpe客户端-创新互联
转载来源:http://cdkjz.cn/article/idhoh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220