nagios监控故障排除

一、安装完nagios及nagios-plugins时,卡在这了,forbidden 禁止访问
php

apache日志显示以下ios

Directory index forbidden by Options directive: /usr/local/nagios/share/web

一、apache的配置问题默认页面是不是index.php,还有是否支持php模块(ll /etc/httpd/conf.d/php.confapache

二、相应目录的权限问题 是否可读app

三、是否正确配置的帐户验证,ide

以下示例:ui

配置http验证 【配置验证时注意验证用户的名字,建议为nagiosadmin,否则就记得修改cgi.cfg及contact.cfg保持帐号的一致,否则就会遇到下面的错误5.】this

两种方式spa

第一种方式,在安装nagios的时候,直接makeinstall –webconf日志

这个会在/etc/httpd/conf.d/生成一个nagios.conf文件

htpasswd-c /etc/nagios/htpasswd.users  nagiosadmin

第二种方式

直接自行配置nagioshttp验证,可直接在主配置文件nagios.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/etc/nagios/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/etc/nagios/htpasswd

#//用于此目录访问身份验证的文件

Require valid-user

</Directory>

htpasswd-c /etc/nagios/htpasswdnagios

二、The requested URL/nagios/cgi-bin/statusmap.cgi was not found on this server.

没有map图形,

yuminstall gd-devel -y

从新编译,

如果源码安装gd-devel,须要手动来指明gd-lib的存放,经过yum安装的不须要,能够自动加载到

./configure --with-gd-lib=/usr/lib  --with-gd-inc=/usr/include

make install; makeinstall-init; make install-config; make install-commandmode; make install-webconf

重启nagios服务


3、错误:

Error: Service check command'check_nrpe' specified in service 'check_total_procs' for host '192.168.15.183'not defined anywhere!

没有定义nagios的命令模板

编辑commands.cfg 添加便可

例:define command {
       command_name  check_nrpe
       command_line     $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


4、安装nrpe,编译的时候提示如下信息checkingfor SSL headers... configure: error: Cannot find ssl headers缘由是缺乏openssl-devel包,yum -yinstall openssl-devel 问题解决!


5It appears as thoughyou do not have permission to view information for any of the hosts yourequested...

If you believe this is an error, check the HTTP serverauthentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.

解决:

第一种:

配置cgi.cfg

78 use_authentication=1默认值为1,改成0,即取消帐号验证

第二种:一样也是配置cgi.cfg中的参数,

在末行模式下执行 %s/nagiosadmin/username/g

username是你在htpasswd生成的自定义验证用户


开启认证认证的用户必须是 cgi.cfg 配置文件里有的默认是 nagiosadmin
  若是你新建的其余用户须要添加进去多用户用逗号分开
   authorized_for_system_information=nagiosadmin
   authorized_for_configuration_information=nagiosadmin
   authorized_for_system_commands=nagiosadmin
   authorized_for_all_services=nagiosadmin
   authorized_for_all_hosts=nagiosadmin
   authorized_for_all_service_commands=nagiosadmin
   authorized_for_all_host_commands=nagiosadmin
  若是不是 nagiosadmin 须要到后面添加
  例子 authorized_for_system_information=nagiosadmin,username


愿积极跟贴,共建nagios故障解决手册。。。。

相关文章
相关标签/搜索