您好,登錄后才能下訂單哦!
⑴安裝完nagios,繼續安裝pnp,要注意rrdtool的安裝。
tar -xvzf pnp-0.4.13.tar.gz
cd pnp-0.4.13
./configure
make all
make install
make install-config
make install-init
---------------------------------------------------------------------------------
FAQ:
*** Configuration summary for pnp 0.4.13 02-19-2009 ***
General Options:
------------------------- -------------------
Nagios user/group: nagios nagios
Install directory: /usr/local/nagios
HTML Dir: /usr/local/nagios/share/pnp
Config Dir: /usr/local/nagios/etc/pnp
Path to rrdtool: /usr/local/bin/rrdtool (Version 1.2.23)
RRDs Perl Modules: *** NOT FOUND ***
RRD Files stored in: /usr/local/nagios/share/perfdata
process_perfdata.pl Logfile: /usr/local/nagios/var/perfdata.log
Perfdata files (NPCD) stored in: /usr/local/nagios/var/spool/perfdata/
-----------------------------------------
process_perfdata.pl 安裝在 /usr/local/nagios/share/
配置示例文件安裝在/usr/local/nagios/libexecs
config.php安裝于/usr/local/nagios/etc/pnp
⑵修改配置文件
①
cd /usr/local/nagios/etc/pnp/
cp process_perfdata.cfg-sample process_perfdata.cfg
cp npcd.cfg-sample npcd.cfg
cp rra.cfg-sample rra.cfg
chown -R nagios:nagios *
②
vi /usr/local/nagios/etc/pnp/process_perfdata.cfg
....
LOG_FILE = /usr/local/nagios/var/perfdata.log
#
# Loglevel 0=silent 1=normal 2=debug
#
LOG_LEVEL = 2
#先改為2,為debug模式
③
④
修改etc/nagios.cfg
找到如下幾項,去掉注釋
process_performance_data=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata
⑤
⑥nginx下的安全問題,需作如下配置
修改pnp的web服務器配置文件nginx.conf,請注意安全問題,我這里未做安全驗證。
㈢測試:
為localhost這臺主機在主機圖標旁邊添加個小太陽標記
vi /usr/local/nagios/etc/nagios.cfg
#為這個主機增加小太陽標記
define host{
use linux-server,host-pnp
host_name localhost
alias localhost
address 127.0.0.1
}
#重新加載配置文件
service nagios reload
如果正確此時就會生成pnp文件
[root@localhost ~]# ls /usr/local/nagios/share/perfdata/localhost/
Current_Load.rrd Current_Users.xml PING.rrd Root_Partition.xml
Current_Load.xml HTTP.rrd PING.xml Swap_Usage.rrd
Current_Users.rrd HTTP.xml Root_Partition.rrd Swap_Usage.xml
打開網頁http://localhost/nagios
點擊小太陽就可以看到圖表,同訪問http://localhost/nagios/pnp
FAQ: 注意可能提示這個模塊沒有安裝:
Time/HiRes.pm模塊的安裝:
①執行以下命令安裝該模塊。
#perl -MCPAN -e 'install Time::HiRes'
或安裝Time-HiRes-1.9707.tar.gz
②如果打開pnp頁面提示Hostname is not set,則檢查etc/pnp/里的sample文件都更改正確,檢查templates.cfg文件中url的正確性,還不行就等等,別太心急了,裝完沒那么快出圖。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。