[Pkg-nagios-devel] Bug#626913: nagios-nrpe-server: different process count when invoking check_procs if default shell is /bin/dash instead of /bin/bash

Massimiliano Ferrero m.ferrero at midhgard.it
Mon May 16 10:40:42 UTC 2011


Package: nagios-nrpe-server
Version: 2.12-4
Severity: important


If default shell is /bin/dash then all check_procs commands run though nrpe daemon return a +1 value in the number of processes they count
i.e. if there is one /usr/sbin/acpid process running the check will return 2, more seriously if there are none the check will return one,
so if the check is used to restart dead daemons this won't be done anymore.

The problem is dash-related: this can be easily verified by running

root at server:~# su - nagios -s /bin/dash -c "/usr/lib/nagios/plugins/check_procs -c 1: -a '/sbin/init'"
No directory, logging in with HOME=/
PROCS OK: 2 processes with args '/sbin/init'

root at server:~# su - nagios -s /bin/bash -c "/usr/lib/nagios/plugins/check_procs -c 1: -a '/sbin/init'"                                                                
No directory, logging in with HOME=/                                                                                                                                  
PROCS OK: 1 process with args '/sbin/init'                                                                                                                            
                                                                                                                                                                      
or by reconfiguring default system shell to be bash, then restarting /usr/sbin/nrpe and having nagios repeat all the process checks.

I think I've tracked the problem to code line 1384 of file nrpe.c

		/* run the command */
                fp=popen(command,"r");

since popen should do a
/bin/sh -c command
it is sensible to the default shell.

I have not been able yet to discover why dash modify check_procs behaviour.

For us at the moment workaround is reconfiguring /bin/bash as default shell, but of course we would prefer to conform to Debian standard.

Best regards
Massimiliano

-- System Information:
Debian Release: 6.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/24 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages nagios-nrpe-server depends on:
ii  adduser                 3.112+nmu2       add and remove users and groups
ii  libc6                   2.11.2-10        Embedded GNU C Library: Shared lib
ii  libssl0.9.8             0.9.8o-4squeeze1 SSL shared libraries
ii  libwrap0                7.6.q-19         Wietse Venema's TCP wrappers libra
ii  lsb-base                3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip

Versions of packages nagios-nrpe-server recommends:
ii  nagios-plugins                1.4.15-3   Plugins for the nagios network mon
ii  nagios-plugins-basic          1.4.15-3   Plugins for the nagios network mon

nagios-nrpe-server suggests no packages.

-- no debconf information





More information about the Pkg-nagios-devel mailing list