设置PNP4nagios – 无法findNagios环境

我的系统configuration如下:
Ubuntu 14.04LTS
Nagios Core 4.0.8
Plugins @ ver 2.0.3
PNP 0.4.13

最新的apache,perl,rrdtool等Nagios一直在正常工作,只是增加了一个远程主机进行testing。

我遵循PNP文档,但我确信我做错了什么。

安装PNP4nagios后,网站无法访问,我意识到,pnp4nagios.conf在/etc/httpd/conf.d/所以我执行./configure --with-httpd-conf=/etc/apache2/conf-available和再次安装它。

然后安装页面显示良好,一切都是绿色的。 我将install.php重命名为install.done.php,并将nagiosconfiguration为在同步模式下工作。

加载http:/// pnp4nagios /我得到一个错误,告诉我perfdata目录是空的,的确如此。

所以我运行了verify_pnp_config,如下所示: perl verify_pnp_config -m sync -c /usr/local/nagios/etc/nagios.cfg -p /usr/local/pnp4nagios/etc给出followinf输出:

http://pastebin.com/m4revFW8

也许这些线路是错误的?

[INFO] host_query =
[INFO] service_query =

然后我在process_perfdata.cfg中设置LOG_LEVEL 2,他在perfdata.log中告诉我

2014-11-05 04:37:30 [9049] [2]使用Config File /usr/local/pnp4nagios/etc/process_perfdata.cfg参数

 2014-11-05 04:37:30 [9049] [2] Default Timeout: 15 secs. 2014-11-05 04:37:30 [9049] [2] Config Timeout: 15 secs. 2014-11-05 04:37:30 [9049] [2] Actual Timeout: 15 secs. 2014-11-05 04:37:30 [9049] [1] process_perfdata.pl-0.6.24 starting in SYNC Mode 2014-11-05 04:37:30 [9049] [1] Cant find Nagios Environment. Exiting .... 

我用在commands.cfg(主机和服务)的命令:

 command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA 

要么

 command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA 

要么

 command_line perl /usr/local/pnp4nagios/libexec/process_perfdata.pl command_line perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA 

但是我没有任何区别。

TL; DR

+ perfdata目录是空的。
+ verify_pnp_config输出是http://pastebin.com/m4revFW8
+ perfdata.log说:

 2014-11-05 04:37:30 [9049] [2] Using Config File /usr/local/pnp4nagios/etc/process_perfdata.cfg parameters 2014-11-05 04:37:30 [9049] [2] Default Timeout: 15 secs. 2014-11-05 04:37:30 [9049] [2] Config Timeout: 15 secs. 2014-11-05 04:37:30 [9049] [2] Actual Timeout: 15 secs. 2014-11-05 04:37:30 [9049] [1] process_perfdata.pl-0.6.24 starting in SYNC Mode 2014-11-05 04:37:30 [9049] [1] Cant find Nagios Environment. Exiting .... 

显然,这是一个Nagios 4的bug,在这里,pnp4nagios使用的环境数据不是在同步模式下提供的。

http://www.monitoring-portal.org/wbb/index.php?page=Thread&postID=210275#post210275

切换到批量+ npcd模式,解决了这个问题。