nagios的客戶端簡單配置與除錯方法

2021-08-27 06:11:57 字數 1261 閱讀 7704

之前寫過nagios和centreon的安裝,寫的很亂不好意思。這次正好又配nagios,於是寫一下nagios的最簡單配置和執行不正確的除錯方法

nagios監控要跑起來必須裝服務端和客戶端兩個地方。 服務端裝nagios,客戶端裝nrpe和nagios-plugins,後者就是nrpe可以執行的監控指令碼,也是我們寫的廣大開源監控包

服務端安裝nagios在此略過 客戶端安裝nrpe的配置

./configure --prefix=$nrpe_dir --with-ssl-lib=/usr/lib/x86_64-linux-gnu --with-nrpe-user=nagios --with-nrpe-group=nagios --with-nagios-user=nagios --with-nagios-group=nagios

安裝nagios-plugins的配置

./configure --prefix=$home/services/nagios/nrpe --with-nagios-user=nagios --with-nagios-group=nagios

allowed_hots=127.0.0.1, 192.168.168.254

command[check_load]=/nagiosposition/nagios/nrpe/libexec/check_load -w 15,10,5 -c 30,25,20 2>/tmp/nagios-error.log

command[check_df]=/nagiosposition/nagios/nrpe/libexec/check_disk -w 10% -c 5% -a -i /ssd

這裡是把錯誤重定向到了/tmp/nagios-error.log檔案中,不可把標準輸出重定向到別處,不然服務端連過來就會出錯。
2>/tmp/nagios-error.log

執行nrpe

bin/nrpe -c nrpe.cfg -d

客戶端配好之後,如何才能在服務端看到監控指令碼是否正確呢,這就需要使用check_nrpe這個指令碼 在服務端執行

libexec/check_nrpe -h 192.168.10.5 -c check_disk
如果客戶端執行正常,這裡就可以返回結果,這也是前面千萬不能在客戶端把標準輸出重定向的原因

如果服務端說檢查錯誤呢?這就需要跳到客戶端去執行一下nrpe.cfg中配的命令是否可以正常執行了

nagios客戶端安裝與配置windows篇

一 被監控的windows xp客戶端的配置 nsclient 0.3.8 win32.msi nsclient 0.3.8 x64.msi 2 安裝nsclient 雙擊安裝 next 同意 next next next 設定允許ip,設定密碼 這裡密碼一般可以不設定 modules to loa...

nagios 客戶端安裝

安裝到 被監控的機器上 新增使用者和組 useradd nagios groupadd nagcmd 如果安裝中報沒有c編譯器,就 yum install gcc wget tar xzvf nagios plugins 1.4.15.tar.gz cd nagios plugins 1.4.15 ...

linux安裝nagios客戶端

安裝到 被監控的機器上 新增使用者和組 useradd nagios groupadd nagcmd usermod a g nagcmd nagios 如果安裝中報沒有c編譯器,就 yum install gcc wget tar xzvf nagios plugins 1.4.15.tar.gz...