Package: munin-plugins-core
Version: 2.0.33-1
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***


I have set munin to have plugin called ps_perl. Other ps_* plgins are
working fine, but the perl one broke in fall january 2017.

All ps_* plugins used to work fine for a few weeks after setting them.
But after some systme update, ps_perl stopped working.

My thinking is that /usr/bin/pgrep changed behaviour in january.
/usr/bin/pgrep is owned by procps. Here is why I think so:

# $PGREP -f -l "\<apache2\>"
685 apache2
692 htcacheclean
4025 apache2
5800 apache2
5803 apache2
...

But ...
# $PGREP -f -l "\<perl\>"
23689 munin-node
27041 zmdc.pl
27191 zmfilter.pl
27200 zmaudit.pl
27208 zmwatch.pl
27215 zmtelemetry.pl

So, for some reason, gprep will show the process name for most process,
but, for scripts, it will show the name of calling script. And,
according to my Munin graphs, plugin had been working fine for 3 weeks.
So, I guess there must have been an update of procps somewhere around
january (or a few months before; I rarely update).

So, once pgrep shows calling script instead of binary file, the next
filter will fail:
$PGREP -f -l "$name" | grep "$REGEX" | grep -v grep | wc -l
will fail on the middle part '' grep "$REGEX" '' for obvious reasons.
Then, plugin returns value of 0 even when many process are running. For
me, this issue occurs only on perl, which happens to be a script
interpreter; plugin works fine for apache2 and kworker.

There are tons of ways to fix this on plugin side.

But, this may also reveal a change of behaviour of pgrep in the bad way
... and if so, this may affect many other scripts relying on pgrep. So,
potentially, any script calling /usr/bin/pgrep, and/or any package
depending on procps.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.8.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages munin-plugins-core depends on:
ii  munin-common  2.0.33-1
ii  perl          5.24.1~rc4-1

Versions of packages munin-plugins-core recommends:
ii  libnet-snmp-perl  6.0.1-2

Versions of packages munin-plugins-core suggests:
pn  conntrack                <none>
pn  libcache-cache-perl      <none>
ii  libdbd-mysql-perl        4.041-1
ii  libnet-dns-perl          1.06-1
pn  libnet-netmask-perl      <none>
pn  libnet-telnet-perl       <none>
ii  libxml-parser-perl       2.44-2+b1
ii  python                   2.7.11-2
pn  ruby | ruby-interpreter  <none>

-- no debconf information

Reply via email to