nagios用戶端之nrpe3.2.1安裝

來源:互聯網
上載者:User

標籤:pen   logs   pac   表示   get   plugin   mic   www   運行   

1、刪除dpkg安裝的nrpe
dpkg -l | grep nrpe
dkpg -P nagios-nrpe-server

2、ubuntu下nrpe3.2.1安裝

下載nrpe3.2.1的源碼包:https://jaist.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.2.1.tar.gz

在用戶端運行nrpe時需要nagios外掛程式的支援,我下載的是nagios-plugins-2.1.2.tar.gz

https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz#_ga=2.34825377.148967917.1508120974-2090824792.1508120974

3、編譯安裝前先檢查有沒有安裝libssl-dev xinetd openssl-devel等等相關包,如沒有安裝,請安裝。
例:
apt-get install libssl-dev

4、建立nagios使用者及使用者組

useradd -s /sbin/nologin nagios


5、解壓下載的nagios外掛程式

tar zxvf nagios-plugins-2.1.2.tar.gz

cd nagios-plugins-2.1.2

6、編譯安裝外掛程式(預設安裝路徑在/usr/local/nagios,如不存在會自動建立)

./configure

make && make install


7、解壓下載的nrpe 3.2.1源碼包

tar zxvf nrpe-3.2.1.tar.gz

8、編譯安裝

cd nrpe-3.2.1

./configure

make all

make install

9、安裝check_nrpe外掛程式:

make install-plugin

10、安裝daemon

make install-daemon

nrpe daemon會運行相應的nagios外掛程式來檢查資訊,並將資訊返回給check_nrpe外掛程式然後交給nagios處理

安裝設定檔:

nrpe3.0之前版本執行make install-daemon-config,
nrpe3.0以上版本下執行此命令時會提示沒有這個參數

[[email protected] nrpe-3.2.1]# make install-daemon-config

make: *** No rule to make target `install-daemon-config‘. Stop.

在nrpe3.2.1版本下需要執行

[[email protected] nrpe-3.2.1]# make install-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

這時可以看到安裝時修改了etc目錄的許可權,把設定檔複製到了etc目錄下

11、安裝起動檔案:

make install-inetd #install the startup files for inetd, launchd, etc.";\

make install-init #install the startup files for init, systemd, etc
12、修改設定檔(該設定檔中寫入nagios服務端以及需要寫入調用監控的指令碼命令,監控的指令碼都放在libexec下)

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

在設定檔中找到

allowed_hosts=127.0.0.1

這行表示允許本地訪問。這裡是用戶端,需要允許伺服器端訪問,我們需要在這行下面再添加一行

allowed_hosts=10.0.1.210

設定nagios伺服器的的ip。

啟動服務

service start nrpe

設定開機啟動

service enable nrpe

使用check_nrpe外掛程式進行測試,我們按裝的check_nrpe及其它nagios外掛程式都安裝在/usr/local/nagios/libexec目錄下,進入此目錄執行

[[email protected] libexec]# ./check_nrpe -H 127.0.0.1

NRPE v3.2.1

 

可以參考相關部落格:
http://www.cnblogs.com/cornell/p/3818558.html
http://blog.itpub.net/29569333/viewspace-1154196/
http://comic945.lofter.com/post/1ead6bdb_e5ce67f
http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html
http://www.cnblogs.com/ilanni/p/4366232.html

nagios用戶端之nrpe3.2.1安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.