如果已分发 Nagios 的 puppet 检查,可从https://github.com/liquidat/nagios-icinga-checks/blob/master/check_puppetagent
我的问题是,如果我在本地执行与通过 NRPE 执行,我会得到不同的结果:
[root@nagios-client /]# /usr/lib64/nagios/plugins/check_puppetagent
OK: Puppet was last run 17 minutes and 9 seconds ago
对比
[root@nagios ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.50.121 -c check_puppetagent
WARN: Puppet has never run, no /opt/puppetlabs/puppet/cache/state/last_run_summary.yaml found.
在客户端上编辑文件/usr/lib64/nagios/plugins/check_puppetagent
并将行更改为:
summary = '/opt/puppetlabs/puppet/cache/state/last_run_summaries.yaml'
会产生预期的结果:
[root@nagios ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.50.121 -c check_puppetagent
WARN: Puppet has never run, no /opt/puppetlabs/puppet/cache/state/last_run_summaries.yaml found.
所以我知道正在执行正确的文件。
从远程工作手动执行它:
[root@nagios ~]# ssh 192.168.50.121 "/usr/lib64/nagios/plugins/check_puppetagent"
root@192.168.50.121's password:
OK: Puppet was last run 13 seconds ago
Antone 有什么想法/建议我还能做些什么来排除故障?