- 论坛徽章:
- 0
|
本帖最后由 intgoo 于 2010-05-11 07:51 编辑
首先简单介绍下我的环境。
freebsd7.2+apache2.2+php5.2+gd2.0+zned2.2
http.conf中有
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory "/usr/local/nagios/sbin/">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
Alias /nagios /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
然后还设置了hosts.cfg 、services.cfg 、contacts.cfg等
这是services.cfg的内容
define service{
host_name xp-test
service_description check-host-alive
check_command check-host-alive
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups admins
}
这是hosts.cfg的内容
define service{
host_name xp-test
service_description check-host-alive
check_command check-host-alive
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups admins
}
contacts.cfg和contactgroups.cfg都设置正确了
用/path/nagios -v /path/nagios.cfg检查
Total Warnings: 0
Total Errors: 0
/path/nagios -d /path/nagios.cfg启动没错误,日志是下面的内容
[1273508523] Nagios 3.2.1 starting... (PID=35196)
[1273508523] Local time is Tue May 11 00:22:03 CST 2010
[1273508523] LOG VERSION: 2.0
[1273508523] Finished daemonizing... (New PID=35197)
打开http://ip/nagios输入用htpasswd生成的密码能正常访问,但打开一下的项目时候都显示
Whoops!
Error: Could not open main config file '/usr/local/test/etc/nagios.cfg' for reading!
Here are some things you should check in order to resolve this error:
Make sure you've installed a main config file in its proper location. See the error message about for details on where the CGI is expecting to find the configuration file. A sample main configuration file (named nagios.cfg) can be found in the sample-config/ subdirectory of the Nagios source code distribution.
Make sure the user your web server is running as has permission to read the main config file.
Make sure you read the documentation on installing and configuring Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.
最后不补充下nagios目录是u=nagios , g=nagios。另外www用户属于nagios组
nagios:*:1002:www,权限是755.
这个问题我发表在了freebsd区,但是貌似没人回答我。
求解~~~
不论是大侠还是路人,知道的帮忙排解下。或者帮顶下 。 多谢各位先 |
|