我安装了一个全新的nagios服务器,并安装了一个新的nconf。 我只需要看看nconf如何生成ngaios的configuration文件。
但是当我点击Generate Nagiosconfiguration后 ,我得到:
Nagios Core 4.0.5 Copyright (c) 2009-present Nagios Core Development Team and Community Contributors Copyright (c) 1999-2009 Ethan Galstad Last Modified: 04-11-2014 License: GPL Website: http://www.nagios.org Reading configuration data... Error: Cannot open main configuration file '/opt/htdocs/nconf/temp/test/Default_Collector.cfg' for reading! Error processing main config file!
我以为nconf是生成文件,但它想要读取一个文件。 我不知道我应该提供给nconf的文件。 如此困惑,需要帮助。
但是Default_Collector.cfg文件不存在 。 没有这样的目录/ opt / htdocs / nconf / temp / test /。 在/ opt / htdocs / nconf / temp /
编辑:权限设置
[root@localhost nconf]# ll |grep ^d drwxr-xr-x 2 apache root 4096 Dec 11 2011 ADD-ONS drwxr-xr-x 3 apache root 4096 Dec 11 2011 bin drwxrwxr-x 2 apache apache 4096 Apr 30 11:14 config drwxr-xr-x 2 apache root 4096 Dec 11 2011 config.orig drwxr-xr-x 3 apache root 4096 Dec 11 2011 design_templates drwxr-xr-x 3 apache root 4096 Dec 11 2011 img drwxr-xr-x 9 apache root 4096 Dec 11 2011 include drwxrwxr-x 2 apache apache 4096 Apr 30 11:28 output drwxrwxr-x 2 apache apache 4096 Dec 11 2011 static_cfg drwxrwxr-x 2 apache apache 4096 Apr 30 11:29 temp [root@localhost nconf]# ps -ef|grep apache root 15568 15528 0 10:14 pts/0 00:00:00 grep apache apache 26125 1 0 Apr29 ? 00:00:01 /usr/local/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf apache 26126 26125 0 Apr29 ? 00:00:00 /usr/bin/php-cgi apache 26127 26126 0 Apr29 ? 00:00:15 /usr/bin/php-cgi
是的,找出我的。 在我的情况下,这是一个全新的CentOS 6.8安装,通过yum安装所有默认或epel软件包(没有任何手动滚动的系统)。
无论如何,支持perl脚本的nconf / bin / generate_config.pl至less有两个perl软件包依赖关系,我失踪了,失败了。 尽pipe运行generate_config.pl的包装器脚本尝试检测故障,但是它没有看到来自perl脚本的错误,所以包装器脚本继续下去,并且基本上从零开始创build一个新的nagiosconfiguration(因为没有生成generate_config.pl)因此这个错误。
运行yum install perl-DBI perl-DBD-MySQL为我解决了这个问题,但是它也可能是其他缺less的perl软件包,或者是来自generate_config.pl的不能被wrapper脚本识别的错误。 我的build议是尝试手动运行perl脚本,如sudo -u apache /opt/nconf/bin/generate_config.pl 。 一旦你得到这个部分的工作,你将需要清除你的/ opt / nconf / temp文件夹之前,networkingnconf应用程序会让你生成另一个configuration集。
祝你好运!
确保以下目录可由用户nconf正在运行。
/opt/htdocs/nconf/config /opt/htdocs/nconf/output /opt/htdocs/nconf/static_cfg /opt/htdocs/nconf/temp