可以看到有错误:NSClient - ERROR: PDH Collection thread not running.
Google 一下,是由于操作系统语言的问题,好像NSClient默认支持的语言并不多,具体可以百度一下。
查看NSClient的日志C:\NSClient++-0.2.7\nsclient.log,信息如下:
2013-09-26 14:10:26:error:.\PDHCollector.cpp:69: Getting counter info...
2013-09-26 14:10:26:error:.\PDHCollector.cpp:97: Detected language: 0x0804 but it could not befound in: counters.defs
2013-09-26 14:10:26: error:.\PDHCollector.cpp:98: You need to manuallyconfigure performance counters!
Nagios配置完成 十一、Nagios安装过程中的常见错误解决方法
1、通过httpd来管理Nagios
Nagios,localhost总是会报警告:“WARNING: HTTP/1.1 403 Forbidden ”
解决方法:
[root@localhosthtml]# pwd
/var/www/html
[root@localhosthtml]# touch index.html
[root@localhosthtml]# echo “hello”> index.html
//在httpd的站点目录下新建一个Indexes.html的网页文件
=====================================================================
2、Nagios配置nrpe出现如下错误:
CHECK_NRPE: Error - Could not complete SSL handshake.
解决方法:
① 确保两边的防火墙都可以让5666端口通过!
② 在被监控的Linux主机中修改文件
#vi/etc/xinetd.d/nrpe
only_from //增加主控IP
#vi /usr/local/nagios/etc/nrpe.cfg
allowed_hosts //增加主控IP
#service xinetd restart
==================================================
3、看不到nrpe进程.
解压方法:
①原因很大是因为服务器上开启了xinetd. 关闭xinetd进程即可
② 因为一般都使用的是-d模式启动的nrpe进程,那么它是独立起的demon进程,所以如果xinetd进程也在的话,nrpe就起不来.
③ 如果使用-i模式启动,那么就必须要启动xinetd守护进程.
/etc/init.d/xinetdstop
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
为了方便的控制nrpe服务,这里提供一个小的脚本。
4、认证错误一:
It appears as though you do nothave permission to view information for any of the hosts you requested
解决方法:
①修改/usr/local/nagios/etc/cgi.cfg中的use_authentication=1改为0
sed -i 's/use_authentication=1/use_authentication=0/g'/usr/local/nagios/etc/cgi.cfg
(取消了认证可以浏览主机状态但是无法在 nagiosweb端执行外部命令 )
② 登陆 nagios web接口的用户,需要和 /usr/local/nagios/etc/cgi.cfg 里面配置的用户匹配,没有可以手动添加,用逗号隔开。
5、认证错误二:
Sorry Dave, I can't let you do that... It seemsthat you have chosen to not use the authentication functionality of the CGIs. Idon't want to be personally responsible for what may happen as a result ofallowing unauthorized users to issue commands to Nagios,so you'll have todisable this safeguard if you are really stubborn and want to invite trouble.Read the section on CGI authentication in the HTML documentation to learn howyou can enable authentication and why you should want to.
原因 : 未开启认证
解决方法:开启认证可解决问题,编辑文件 /usr/local/nagios/etc/cgi.cfg,将 use_authentication 值设成1 (0/1 关闭/开启)use_authentication=1,并重启 nagios service nagios restart
6、认证错误三:
It appears as though you do not have permissionto view information for any of the hosts you requested... If you believe thisis an error, check the HTTP server authentication requirements for accessingthis CGI and check the authorization options in your CGI configuration file.
原因 : 认证用户不正确
解决方法:
开启认证:认证的用户必须是 cgi.cfg 配置文件里有的默认是 nagiosadmin,如果你新建的其他用户,需要添加进去,多用户用逗号分开
authorized_for_system_information=nagiosadminauthorized_for_configuration_information=nagiosadminauthorized_for_system_commands=nagiosadminauthorized_for_all_services=nagiosadmin authorized_for_all_hosts=nagiosadminauthorized_for_all_service_commands=nagiosadminauthorized_for_all_host_commands=nagiosadmin
如果不是 nagiosadmin 需要到后面添加,例子authorized_for_system_information=nagiosadmin,admin