加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – NRPE:无法读取输出

发布时间:2020-12-13 16:53:27 所属栏目:Linux 来源:网络整理
导读:我尝试监控 MySQL数据库: [root@monitored.com ~]# su nagios -c /usr/lib/nagios/plugins/check_mysql Uptime: 18014 Threads: 1 Questions: 6 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.000 但我有意想不到的
我尝试监控 MySQL数据库:

[root@monitored.com ~]# su nagios -c /usr/lib/nagios/plugins/check_mysql
Uptime: 18014 Threads: 1 Questions: 6 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.000

但我有意想不到的错误:

[ec2-user@monitoring.com ~]$/usr/lib/nagios/plugins/check_nrpe -H monitored.com -c check_mysql
NRPE: Unable to read output

怎么了?

解决方法

调试正在执行的命令没有返回任何有效输出的一个好方法是使用strace.例如,我在通过NRPE运行check_linux_raid命令时遇到问题.

运行strace -f -p< nrpe pid>,然后从运行nagios的系统手动执行命令(例如/usr/lib64 / nagios / plugins / check_nrpe -H remotename -c commandname -a arg1 arg2 …).

扫描strace的输出以查找错误,例如拒绝权限或可能发生的其他类似错误.例如,在我的情况下,selinux在从远程计算机运行时拒绝对文件的许可,即使该用户具有对该文件的本地访问权限.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读