溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

在FreeBSD下配置nrpe服務(wù)

發(fā)布時(shí)間:2020-06-18 21:45:35 來源:網(wǎng)絡(luò) 閱讀:740 作者:始終不完美 欄目:移動開發(fā)

安裝nrpe

將以下軟件包上傳到相應(yīng)目錄,安裝步驟如下:

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

修改內(nèi)容如下:

刪除199-203行

查找allowed_hosts=127.0.0.1,修改為allowed_hosts=127.0.0.1,115.182.59.202      //115.182.59.202為nagios服務(wù)器端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

配置開機(jī)自動啟動

vi /etc/rc.local              

內(nèi)容如下:

#!/bin/sh

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

 
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI