您好,登录后才能下订单哦!
⑴安装完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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。