1.关闭selinux
/usr/sbin/sestatus -v
getenforce
setenforce 0
2.Error: Could not read object configuration data!
nagios 未启动
/etc/rc.d/init.d/nagios start
或
/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
解决:
登陆 nagios web接口的用户,需要和 /usr/local/nagios/etc/cgi.cfg 里面配置的用户匹配,没有可以手动添加,用逗号隔开
添加或修改为一致的用户
4.HTTP/1.1 403 Forbidden
运行的nagios 用户无法访问默认的apache 目录,不具备权限
赋值即可
5.监控上看到的 PENDING 状态
实属未获取到数据,等待即可
6.NRPE 参数传递不成功
因为编译的时候未带上参数
./configure --enable-command-args
同时配置nrpe.cfg
dont_blame_nrpe=1
7.CHECK_NRPE: Error - Could not complete SSL handshake.
nrpe.cfg 中未添加允许监控机访问
allowed_hosts=192.168.146.172
8. sendmail
Program mode requires special privileges, e.g., root or TrustedUser.
属主不正确
chown root.smmsp /bin/mail
chown root.smmsp /usr/sbin/sendmail.sendmail
重启sendmail
/etc/init.d/sendmail stop
/etc/init.d/sendmail start
9.sendmail 错误
can not chdir(/var/spool/clientmqueue/): Permission denied
chown -R smmsp.nagios /var/spool/clientmqueue
调整为 nagios 允许用户访问
10.syntax illegal for recipient addresses
undisclosed-recipients:
默认配置中无相关配置
修改mail 配置文件
#sendmail.cf:#O NoRecipientAction=none
submit.cf:#O NoRecipientAction=none
改成:add-to
action to take if there are no recipients in the message
#O NoRecipientAction=add-to-undisclosed
如果邮件在标题行中没有收件人的信息,NoRecipientAction选项指示sendmail采取的措施。
add-appanently-to:添加一个"Appanently-To"标题。
add-bcc:添加一个空"BCC"标题行以便遵循RFC 821规范。
add-to:添加一个"To"标题,以及从邮件"信封"获得的收件人。
add-to-undisclosed:添加一个空"To:undisclosed-recipients:;"标题。
none:不修改邮件内容便发送。
11.It appears as though you do not have permission to view information you requested........
方法1:
改cgi.cfg文件里的一个参数 use_authentication=1 将1改为0,重启nagios即可
方法2:
vi /usr/local/nagios/etc/cgi.cfg
nagiosadmin是我们用来登录nagios的管理员,而cgi.cfg就是用来验证管理员身份的!
如果你生成的管理员用户不是nagiosadmin,验证的时候就会失败
将以下的几项中的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
12.CHECK_NRPE: Error - Could not complete SSL handshake.
监控机IP无权限访问,需要添加allows_hosts
13.NRPE: Unable to read output
自定义脚本无执行权限
chmod 777 file.sh