nagios的安装错误

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

相关推荐
GeW5 小时前
新质生产力路线图:从Linux到数据库,企业落地要点都在这
linux
IMPYLH5 小时前
Linux 系统备份与镜像
linux·服务器·网络
qetfw5 小时前
Bash 字符串处理:参数展开、序列与脚本执行方式
linux·开发语言·chrome·bash
hhwyqwqhhwy5 小时前
设备树之 provider 和 consumer
java·linux·前端
aaa最北边6 小时前
Linux 上的交叉编译
linux·运维·服务器
小张成长计划..6 小时前
【Linux】27:日志
linux·运维·服务器
别动我齐刘海7 小时前
机器人 C++ / 系统联调补强2——异常处理、Protobuf
linux·c++·人工智能·学习·算法·机器学习·机器人
Lsetea7 小时前
curl -I检查HTTPS返回405:HEAD、GET与证书验收分层排查
linux·http·https·ssl证书·curl
一直C7 小时前
嵌入式 Linux 驱动开发学习笔记:内核定时器、platform 总线与 I²C 驱动
linux·驱动开发·嵌入式硬件·学习·imx6ull
承渊政道8 小时前
Linux网络学习【传输层协议UDP】
linux·网络·网络协议·学习·ubuntu·udp