在FreeBSD下配置nrpe服务-创新互联

安装nrpe

创新互联公司2013年至今,先为林周等服务建站,林周等地企业,进行企业商务咨询服务。为林周企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

将以下软件包上传到相应目录,安装步骤如下:

nagios-plugins-1.4.15.tar.gz

nrpe-2.12.tar.gz

pw useradd nagios -d /home/nagios -s /usr/sbin/nologin

tar zxvf nagios-plugins-1.4.15.tar.gz

cd nagios-plugins-1.4.15

./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios

make && make install

cd

tar zxvf nrpe-2.12.tar.gz

cd nrpe-2.12

./configure --enable-ssl --with-nrpe-user=nagios --with-nrpe-group=nagios --with-nagios-user=nagios --with-nagios-group=nagios

make all

make install-plugin

make install-daemon

make install-daemon-config

cd

vi /usr/local/nagios/etc/nrpe.cfg

修改内容如下:

删除199-203行

查找allowed_hosts=127.0.0.1,修改为allowed_hosts=127.0.0.1,115.182.59.202    //115.182.59.202为nagios服务器端ip

echo 'command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20' >> /usr/local/nagios/etc/nrpe.cfg

echo 'command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%' >> /usr/local/nagios/etc/nrpe.cfg

echo 'command[check_root]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /' >> /usr/local/nagios/etc/nrpe.cfg

echo 'command[check_data]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /data' >> /usr/local/nagios/etc/nrpe.cfg

echo 'command[check_usr]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /usr' >> /usr/local/nagios/etc/nrpe.cfg

echo 'command[check_var]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /var' >> /usr/local/nagios/etc/nrpe.cfg

echo 'command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z' >> /usr/local/nagios/etc/nrpe.cfg

echo 'command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 300 -c 450' >> /usr/local/nagios/etc/nrpe.cfg

chown -R nagios:nagios /usr/local/nagios

awk 'BEGIN{print "nrpe\t\t5666/tcp  #NRPE"}' >> /etc/services

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

sockstat -4l|grep nrpe

重启nrpe

pkill nrpe

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

配置开机自动启动

vi /etc/rc.local

内容如下:

#!/bin/sh

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

 

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


网站题目:在FreeBSD下配置nrpe服务-创新互联
文章来源:http://hbruida.cn/article/cdephg.html