Nagios NRPE check_procs报告不正确的号码

我有一个蚀刻nagios服务器(我将称之为NagiosServer),成功地监视了很多东西,包括另一个蚀刻服务器(MonitorEtch)。 使用check_nrpe和check_procs,我可以检查运行守护进程的进程列表,比如'/ usr / sbin / squid'。

从NagiosServer中检查MonitorEtch(正确的结果):

/usr/lib/nagios/plugins/check_nrpe -H MonitorEtch -c check_process -a /usr/sbin/squid 1:1 1:1 PROCS OK: 1 process with args '/usr/sbin/squid' /usr/lib/nagios/plugins/check_nrpe -H MonitorEtch -c check_process -a whatever 1:1 1:1 PROCS CRITICAL: 0 processes with args 'whatever' 

我已经build立了一个我想监视的新服务器,运行Lucid(MonitorLucid)。 无论我从NagiosServer尝试和监视哪个进程,我都会得到比我更高的结果。

从NagiosServer中检查MonitorLucid(不正确的结果):

 /usr/lib/nagios/plugins/check_nrpe -H MonitorLucid -c check_process -a whatever 1:1 1:1 PROCS OK: 1 process with args 'whatever' ps ax|grep sophie 12737 ? Ss 0:00 /usr/sbin/sophie -D 12738 ? S 0:03 /usr/sbin/sophie -D 19591 pts/0 S+ 0:00 grep --color=auto sophie /usr/lib/nagios/plugins/check_nrpe -H 192.168.19.252 -c check_process -a sophie 1:1 1:1 PROCS CRITICAL: 3 processes with args 'sophie' 

MonitorLucid / MonitorEtch上/etc/nagios/nrpe_local.cfg的内容:

 allowed_hosts=NagiosServer,127.0.0.1 dont_blame_nrpe=1 command[check_process]=/usr/lib/nagios/plugins/check_procs -a $ARG1$ -m PROCS -w $ARG2$ -c $ARG3$ 

但是,如果我在本地执行检查,则会返回正确的结果!

从MonitorLucid中检查MonitorLucid(正确的结果):

 /usr/lib/nagios/plugins/check_procs -a whatever -m PROCS -w 1:1 -c 1:1 PROCS CRITICAL: 0 processes with args 'whatever' /usr/lib/nagios/plugins/check_procs -a sophie -m PROCS -w 1:1 -c 1:1 PROCS CRITICAL: 2 processes with args 'sophie' 

在这一点上,我没有任何意见,只是比我应该多检查一个实例。

我有一个类似的问题。 /bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'在内部调用/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args' ,它列出了进程并对它们进行计数。 如果您已将nagiosconfiguration为使用其他用户运行,则使用sudo执行该命令。 这是问题。 如果你inputsudo ps -AF | grep sudo sudo ps -AF | grep sudo ,一些分发返回“ grep sudo ”,另外一些则返回“ sudo ps -AF ”和“ grep sudo ”。 由于check_procs正在计算所有进程,所以在不同的机器上会得到不同的结果。 不幸的是我没有一个解决scheme,但如何强制check_procs不计算sudo进程。

听起来像在Lucid中的check_procs的版本是越野车(至less已经改变了它的行为); 总是find一个额外的事实表明它正在进程名称和参数的任何部分进行子string匹配,并find与运行该插件相关的一个进程。 值得向Ubuntu报告一个bug。