Bug#761841: munin-plugins-core: proc plugin using too wide glob

2014-09-16 Thread Joerg Jaspert
Package: munin-plugins-core
Version: 2.0.21-2
Severity: normal

Dear Maintainer,

as the subject says, the proc plugin is using a glob for its grep
thats hitting more than intended. It wants to grep from
/proc/$PIDS/stats, but with the current line it does also take things
like /proc/net/stat, and as such leading to loads of lines like the
following in the munin-update.log:

2014/09/16-13:15:26 [587369] Error output from proc:
2014/09/16-13:15:26 [587369]   grep: /proc/net/stat: Is a directory

The fix is simple:

--- /usr/share/munin/plugins/proc   2014-06-13 15:58:52.0 +0200
+++ /tmp/proc   2014-09-16 13:19:53.664683512 +0200
@@ -320,7 +320,7 @@
 $procstats{$procuniq[$i]}{write_bytes} = 0;
 $procstats{$procuniq[$i]}{cancelled_write_bytes} = 0;
 
-STATLINE: foreach my $line(`grep -h \\\($procname[$i]\\\) 
/proc/*/stat`) {
+STATLINE: foreach my $line(`grep -h \\\($procname[$i]\\\) 
/proc/[0-9]*/stat`) {
 $line =~ /^(\d+)/;
 my $cmdline = `cat /proc/$1/cmdline | /usr/bin/perl -F\\\0\ 
-lane '\$s = join(\ \, \@F); print \$s;'`;
 my $cmduid = `cat /proc/$1/status | egrep '^Uid:' | awk '{ print 
\$2 }'`;



Thats still a hack, but now it limits to anything starting with a number.

-- 
bye Joerg


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#761841: [Packaging] Bug#761841: munin-plugins-core: proc plugin using too wide glob

2014-09-16 Thread Holger Levsen
control: tags -1 + patch upstream

Hi Jörg, 

thanks for the bug report with patch, much appreciated!

from #munin, just now:
  h01ger | TheSnide: the fix for #761841 sounds like something nice for 
2.0.22
  h01ger | TheSnide: anything else planned for 2.0.22 yet?


cheers,
Holger


signature.asc
Description: This is a digitally signed message part.