资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

nagios监控故障排除-创新互联

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

创新互联是一家专业提供龙文企业网站建设,专注与成都网站制作、成都做网站、html5、小程序制作等业务。10年已为龙文众多企业、政府机构等服务。创新互联专业网站制作公司优惠进行中。

apache日志显示如下

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

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

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

3、是否正确配置的账户验证,

如下示例:

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

两种方式

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

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

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

第二种方式

直接自行配置nagios的http验证,可直接在主配置文件nagios.conf中添加如下

ScriptAlias/nagios/cgi-bin /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

Alias /nagios/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

htpasswd-c /etc/nagios/htpasswdnagios

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

nagios监控故障排除

没有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 问题解决!

5、It 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故障解决手册。。。。

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页题目:nagios监控故障排除-创新互联
网页地址:http://cdkjz.cn/article/doigpj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220