手机版
你好,游客 登录 注册
背景:
阅读新闻

Nagios插件PNP安装

[日期:2012-12-21] 来源:Linux社区   作者:inbank2012 [字体:大 中 小]

4、重启nagios服务后,在这个目录下会产生2个主机的目录
 
ls /usr/local/nagios/share/perfdata/
 
xxjshyy  xxysix
 
cd xxjshyy
 


-rw-rw-r-- 1 nagios nagioscmd 1151496 Dec 21 16:13 Current_Load.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  12165 Dec 21 16:13 Current_Load.xml
 
-rw-rw-r-- 1 nagios nagioscmd  384952 Dec 21 16:11 Java_9800.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  11208 Dec 21 16:11 Java_9800.xml
 
-rw-rw-r-- 1 nagios nagioscmd  384952 Dec 21 16:12 Java_9801.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  11208 Dec 21 16:12 Java_9801.xml
 
-rw-rw-r-- 1 nagios nagioscmd  384952 Dec 18 17:35 mysql_3306.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  384952 Dec 21 16:11 Mysql_3306.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  11199 Dec 18 17:35 mysql_3306.xml
 
-rw-rw-r-- 1 nagios nagioscmd  11202 Dec 21 16:11 Mysql_3306.xml
 
-rw-rw-r-- 1 nagios nagioscmd  384952 Dec 21 16:12 Nrpe_5666.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  11198 Dec 21 16:12 Nrpe_5666.xml
 
-rw-rw-r-- 1 nagios nagioscmd  768224 Dec 21 16:14 Ping.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  11702 Dec 21 16:14 Ping.xml
 
-rw-rw-r-- 1 nagios nagioscmd  384952 Dec 21 16:14 sda3.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  11170 Dec 21 16:14 sda3.xml
 
-rw-rw-r-- 1 nagios nagioscmd 1534768 Dec 21 16:13 traffic.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  12701 Dec 21 16:13 traffic.xml
 
-rw-rw-r-- 1 nagios nagioscmd  384952 Dec 21 16:12 Users.rrd
 
-rw-rw-r-- 1 nagios nagioscmd  11120 Dec 21 16:12 Users.xml
 

 
 
ps:点击小太阳也能会报以下这种错误:
 


Deprecated: Assigning the return value of new by reference is deprecated in /usr/local/nagios/share/pnp/include/function.inc.php on line 1026
 
 
 
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /usr/local/nagios/share/pnp/include/function.inc.php on line 557
 
 
 
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /usr/local/nagios/share/pnp/include/function.inc.php on line 559
 
 
 
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /usr/local/nagios/share/pnp/include/function.inc.php on line 563
 
 
 
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /usr/local/nagios/share/pnp/include/function.inc.php on line 565
 
 
 
Deprecated: Function eregi() is deprecated in /usr/local/nagios/share/pnp/include/function.inc.php on line 1502
 

解决:
 


这是因为pnp-0.4.14对PHP 5.3.0的支持还不是很好,其中有几个bug需要修改:
 
根据错误提示打开
 
vi /usr/local/nagios/share/pnp/include/function.inc.php
 
找到行1502修改为
 
if($level == 2 && $type == "complete" && preg_match("/^NAGIOS_/",$tag)){
 
还会有两处错误需要修改,根据提示找到对应行进行修改:
 
line 556: 添加:date_default_timezone_set('UTC');
 
line 1026:修改为$pdf = new PDF('P', 'mm', 'A4'); 删除&
 
再重新重启nagios,应该就能看到图表了

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款