我尝试监控 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平均:0.000
但我遇到了意外错误:
[ec2-user@monitoring.com ~]$ /usr/lib/nagios/plugins/check_nrpe -H monitoring.com -c check_mysql NRPE:无法读取输出
怎么了?
调试为什么正在执行的命令没有返回任何有效输出的一种好方法是使用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 在从远程机器运行时拒绝对文件的许可,即使该用户具有对该文件的本地访问权限。
归档时间: |
|
查看次数: |
14453 次 |
最近记录: |