为什么会出现这种情况的:[attach]38918[/attach]
iptables 与 selinux 都已关了
我的安装步骤如下:
nagios部分:
useradd nagios -s /bin/nologin nagios
mkdir /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios
1、nagios-3.4.1.tar.gz
tar zxvf /usr/local/nagios-3.4.1.tar.gz
cd /usr/local/nagios
./configure --prefix=/usr/local/nagios \
--with-gd-lib=/usr/lib \
--with-gd-inc=/usr/include
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf
chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --list nagios
2、nagios-plugins-1.4.15.tar.gz
tar zxvf /usr/local/nagios-plugins-1.4.15.tar.gz &&
cd /usr/local/nagios-plugins-1.4.15 &&
./configure --with-cgiurl=/usr/local/nagios/sbin \
--prefix=/usr/local/nagios \
--with-nagios-user=nagios \
--with-nagios-group=nagios &&
make && make install
3、nagios-cn-3.2.3.tar.bz2
tar xjvf /usr/local/nagios-cn-3.2.3.tar.bz2 &&
cd /usr/local/nagios-cn-3.2.3 &&
./configure &&
make all && make install
apache部分:
(1)apr-util-1.4.1.tar.gz
./configure --prefix=/usr/local/apr/ \
make && make install
(2)apr-1.4.6.tar.gz
./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr \
make && make install
(3)httpd-2.4.2.tar.gz
./configure --prefix=/usr/local/apache/ \
--enable-so \
--with-apr=/usr/local/apr/ \
--with-apr-util=/usr/local/apr-util/ \
--with-pcre=/usr/local/pcre \
--enable-so \
--enable-modles-shared=most \
(4)php-5.4.3.tar.bz2
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs
修改apache配置文件httpd.conf:
ScriptAlias /nagios/cgi-bin "usr/local/nagios/sbin"
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "nagios access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
Alias /nagios "/usr/local/nagios/share"
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "nagios access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
测试nagios的配置: /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
添加nagios认证用户:htpasswd -c /usr/local/nagios/etc/htpasswd xuxiaofeng
[attach]38918[/attach]
鳄鱼的眼泪 于 2012-09-04 21:28:54发表:
[attach]38923[/attach] 5# csg551342
现在问题是监控页面右边的部分都出不来,提示说没权限访问,这是为什么呢[attach]38923[/attach]
[attach]38923[/attach]
于 2012-09-04 21:07:32发表:
csg551342 于 2012-09-04 20:17:58发表:
1.LZ的“修改apache配置文件httpd.conf:
ScriptAlias /nagios/cgi-bin "usr/local/nagios/sbin"”
尝试修改为:
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
再重新启动下Apache服务,如果监控中出现红色警告,参考修改以下2个地方。
###2.#如果提示“Whoops! Error: Could not read object configuration data! ”,这是因为没有启动nagios后台进程,执行以下命令
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
###3.监控页面出现It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
修改/etc/cgi.cfg
vi /usr/local/nagios/etc/cgi.cfg
use_authentication=1 #把1修改为0,保存.
Hopcv 于 2012-09-04 14:43:38发表:
帮你顶一下
鳄鱼的眼泪 于 2012-09-04 13:38:33发表:
[i=s] 本帖最后由 鳄鱼的眼泪 于 2012-9-4 13:44 编辑 [/i]
2# 消失的光年
那个刚开始安装的时候我已经做了,应该不是那个问题
[attach]38919[/attach]
消失的光年 于 2012-09-04 13:27:34发表:
useradd nagios
chown -R nagios.nagios /usr/local/nagios