Nagios安装遇到的问题及解决

1. 如果左边菜单栏出现乱码呢,说明php未加载
2.  右边的520错误解决方法
chmod 777 /var/run/nagios.sock  (参考上面的脚本)
还必须得加到开机启动
其实chown /var/run/nagios.sock  (我这nginx用的账户是www)
将此命令加到/etc/init.d/nagios 启动脚本中就行了
这样就彻底解决。
继续找错误 =_=
3.  左边菜单栏”Map”或者 Alerts--->histogram 不能正常显示的话
如此这般 :cp /usr/local/lib/libiconv.so.2/usr/lib/   做软链接也行。
4.  如果 右边有些栏目显示不出来,比如图像。。。
这般如此 :
mkdir -p /usr/local/nagios/share/nagios
ln -s /usr/local/nagios/share/images /usr/local/nagios/share/nagios/images
ln -s /usr/local/nagios/share/stylesheets/usr/local/nagios/share/nagios/stylesheets
注:
<1>因为nagios要采用认证方式登陆 所以在在处理cgi程序时fastcgi_param文件中必须含有这行
fastcgi_param  REMOTE_USER       $remote_user;
<2>nagios的cgi.cfg文件中启用了认证(use_authentication=1)
如:vi/usr/SA/monitorsys/nagios/etc/cgi.cfg
必须同时满足上面提到的两个条件:我在操作时用nginx 默认的fastcgi_params文件,里面是没有
fastcgi_param  REMOTE_USER       $remote_user;
重启下nagios 或者nginx
这下应该OK了。

5. Sep 26 10:24:20 localhost nagios:Warning: Check result queue contained results for host'91wan_s4_MS_121.10.246.142', but the host could not be found!  Perhaps you forgot to define the host in yourconfig files?

开了两个nagios进程,用 ps aux |grep nagios 可以看到确实是两个进程,杀掉后重启问题解决。

6. nagios界面提示

It appears as though you do not havepermission to view information for anyappears

If you believe this is an error, check theHTTP server authentication requirements for accessing this CGI and check theauthorization options in your CGI configuration file.
修改/usr/local/nagios/etc/cgi.cfg

# vi /usr/local/nagios/etc/cgi.cfg

找到use_authentication=1,将1修改为0,保存退出。

# service nagios restart

待验证:

所有的安装配置里面,都说将cgi.cfg的use_authentication=0,据说这样能够访问全部的页面。事实上,这是一个偷懒的做法,而且在以后必将会更正。

我们会在web页面对一些设置进行更改,在nagios的机制中,都会通过nagios.cmd。而use_authentication=0,会disable external_command_file的使用,于是,所有更改都会提示authentication错误。

正确的做法,首先,将cgi.cfg的use_authentication=1,然后我们授权用户的权限。
authorized_for_system_information=*
authorized_for_configuration_information=*
authorized_for_system_commands=siemsen
authorized_for_all_services=*
authorized_for_all_hosts=*
authorized_for_all_service_commands=*
authorized_for_all_host_commands=*
*代表所有用户,也可以用逗号形式将用户逐一添入(推荐这种方法)。例如:
authorized_for_system_information=nagios,nagiosadmin,www-data,apacheuser

接着,要改变nagios.cmd所在目录/usr/local/nagios/var/rw的权限,命令如下。
chown nagios.nagiocmd /usr/local/nagios/var/rw
chmod u+rwx /usr/local/nagios/var/rw
chmod g+rwx /usr/local/nagios/var/rw
chmod g+s /usr/local/nagios/var/rw
最后重起nagios:
/etc/init.d/nagios restart
再去更新设置,就能成功了!

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/07226832f5e75b2dcf9f5411ad8c687d.html