]> TLD Linux GIT Repositories - packages/munin.git/blob - munin-plugins.patch
- df, url back to regular sourceforge one
[packages/munin.git] / munin-plugins.patch
1 diff -urNp munin-2.0.25.orig/dists/tarball/plugins.conf munin-2.0.25/dists/tarball/plugins.conf
2 --- munin-2.0.25.orig/dists/tarball/plugins.conf        2014-11-24 21:46:24.000000000 +0000
3 +++ munin-2.0.25/dists/tarball/plugins.conf     2015-09-08 10:05:48.873593251 +0000
4 @@ -14,6 +14,9 @@
5  #
6  #
7  
8 +[*]
9 +env.logtail /usr/bin/logtail
10 +
11  [mysql*]
12  #env.mysqlopts -u someuser
13  
14 @@ -31,3 +34,128 @@ user root
15  
16  [postfix*]
17  user root
18 +env.logdir /var/log
19 +env.logfile maillog
20 +
21 +[netstat]
22 +group proc
23 +
24 +[amavis*]
25 +user root
26 +env.amavislog /var/log/maillog
27 +env.logfile /var/log/maillog
28 +
29 +[courier*]
30 +user root
31 +env.logfile /var/log/maillog
32 +
33 +[mailman]
34 +user mailman
35 +group (mailman)
36 +
37 +[bind9_rndc]
38 +group (named)
39 +env.querystats /var/lib/named/named.stats
40 +
41 +[squid*]
42 +group (squid)
43 +#env.squidport 3128
44 +#env.squiduser manager
45 +#env.squidpasswd <SECRET>
46 +
47 +[fw*]
48 +group proc
49 +
50 +[if*]
51 +group proc
52 +
53 +[dhcpd3]
54 +user root
55 +env.leasefile /var/lib/dhcpd/dhcpd.leases
56 +env.configfile /etc/dhcpd.conf
57 +
58 +[ip_*]
59 +user root
60 +
61 +[munin*]
62 +user munin
63 +
64 +[ping_*]
65 +group adm
66 +
67 +[port_*]
68 +group proc
69 +
70 +[processes]
71 +group proc
72 +
73 +[ps_*]
74 +group proc
75 +
76 +[psu_*]
77 +group proc
78 +
79 +[nfs*]
80 +group proc
81 +
82 +[entropy]
83 +group proc
84 +
85 +[open_*]
86 +group proc
87 +
88 +[nut*]
89 +env.upsname SmartUPS
90 +env.upshost 127.0.0.1
91 +
92 +[df*]
93 +#user root     # if you have mode 0000 /vservers dir
94 +group proc
95 +
96 +# Sane defaults for plugins from MuninExchange
97 +
98 +[apache_smaps]
99 +#user root     # if you have kernel with grsecurity
100 +group proc
101 +env.pname httpd.prefork
102 +env.puser http
103 +
104 +[dovecot]
105 +user root
106 +env.logfile /var/log/maillog
107 +
108 +[php_eaccelerator]
109 +env.user admin
110 +env.password eAccelerator
111 +env.url http://127.0.0.1/eaccelerator/control.php
112 +
113 +[proftpd*]
114 +user root
115 +env.logfile /var/log/xferlog
116 +
117 +[vsftpd*]
118 +user root
119 +env.logfile /var/log/vsftpd.log
120 +
121 +[postgrey*]
122 +user root
123 +env.logfile /var/log/maillog
124 +
125 +[nagiosstatus]
126 +user root
127 +env.statuslog /var/lib/nagios/status.dat
128 +
129 +[freeradius]
130 +user root
131 +env.radius_log /var/log/freeradius/radius.log
132 +
133 +[ipmitool_sensor*]
134 +user root
135 +timeout 20
136 +
137 +[openvpn_clients]
138 +user root
139 +env.logfile /var/log/openvpn/status.log
140 +
141 +[cupsys_pages]
142 +user root
143 diff -urNp munin-2.0.25.orig/plugins/node.d/amavis.in munin-2.0.25/plugins/node.d/amavis.in
144 --- munin-2.0.25.orig/plugins/node.d/amavis.in  2014-11-24 21:46:24.000000000 +0000
145 +++ munin-2.0.25/plugins/node.d/amavis.in       2015-09-08 10:05:48.874593251 +0000
146 @@ -77,13 +77,12 @@ GPLv2
147  =cut
148  
149  mktempfile () {
150 -    cmd=`echo $MUNIN_MKTEMP | sed s/\\$1/$1/`
151 -    $cmd
152 +    mktemp -p /tmp/ $1
153  }
154  
155  AMAVIS_LOG=${amavislog:-/var/log/mail/mail.info}
156  LOGTAIL=${logtail:-logtail}
157 -STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
158 +STATEFILE=@@PLUGSTATE@@/amavis.offset
159  
160  if [ "$1" = "autoconf" ]; then
161          if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
162 @@ -106,7 +105,7 @@ fi
163  
164  if [ "$1" = "config" ]; then
165         echo 'graph_title Amavis filter statistics'
166 -       echo 'graph_vlabel \#'
167 +       echo 'graph_vlabel mails'
168         echo 'graph_category antivirus'
169         echo 'virus.label virus'
170         echo 'virus.info Number of viruses caught in email'
171 @@ -124,7 +123,7 @@ virus=U
172  spamm=U
173  spams=U
174  
175 -TEMP_FILE=$(mktempfile munin-amavis.XXXXXX)
176 +TEMP_FILE=$(mktempfile munin-amavis.XXXXXXXXXX)
177  
178  if [ -n "$TEMP_FILE" -a -f "$TEMP_FILE" ]
179  then
180 diff -urNp munin-2.0.25.orig/plugins/node.d/apache_accesses.in munin-2.0.25/plugins/node.d/apache_accesses.in
181 --- munin-2.0.25.orig/plugins/node.d/apache_accesses.in 2014-11-24 21:46:24.000000000 +0000
182 +++ munin-2.0.25/plugins/node.d/apache_accesses.in      2015-09-08 10:05:48.875593251 +0000
183 @@ -89,6 +89,7 @@ if (! eval "require LWP::UserAgent;")
184  
185  my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
186  my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
187 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
188  
189  if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
190  {
191 @@ -129,7 +130,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
192  
193  if ( defined $ARGV[0] and $ARGV[0] eq "config" )
194  {
195 -       print "graph_title Apache accesses\n";
196 +       print "graph_title Apache accesses";
197 +       if ( $HOST ) {
198 +               print " for $HOST";
199 +       }
200 +       print "\n";
201         print "graph_args --base 1000\n";
202         print "graph_vlabel accesses / \${graph_period}\n";
203         print "graph_category apache\n";
204 diff -urNp munin-2.0.25.orig/plugins/node.d/apache_processes.in munin-2.0.25/plugins/node.d/apache_processes.in
205 --- munin-2.0.25.orig/plugins/node.d/apache_processes.in        2014-11-24 21:46:24.000000000 +0000
206 +++ munin-2.0.25/plugins/node.d/apache_processes.in     2015-09-08 10:05:48.876593251 +0000
207 @@ -96,6 +96,7 @@ if (! eval "require LWP::UserAgent;")
208  
209  my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
210  my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
211 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
212  my $SHOWFREE = !exists $ENV{'showfree'} || $ENV{'showfree'};
213  
214  if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
215 @@ -136,7 +137,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
216  
217  if ( defined $ARGV[0] and $ARGV[0] eq "config" )
218  {
219 -        print "graph_title Apache processes\n";
220 +        print "graph_title Apache processes";
221 +       if ( $HOST ) {
222 +               print " for $HOST";
223 +       }
224 +       print "\n";
225          print "graph_args --base 1000 -l 0\n";
226                 print "graph_category apache\n";
227         print "graph_order ";
228 diff -urNp munin-2.0.25.orig/plugins/node.d/apache_volume.in munin-2.0.25/plugins/node.d/apache_volume.in
229 --- munin-2.0.25.orig/plugins/node.d/apache_volume.in   2014-11-24 21:46:24.000000000 +0000
230 +++ munin-2.0.25/plugins/node.d/apache_volume.in        2015-09-08 10:05:48.876593251 +0000
231 @@ -89,6 +89,7 @@ if (! eval "require LWP::UserAgent;")
232  
233  my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
234  my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
235 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
236  
237  if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
238  {
239 @@ -129,7 +130,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
240  
241  if ( defined $ARGV[0] and $ARGV[0] eq "config" )
242  {
243 -       print "graph_title Apache volume\n";
244 +       print "graph_title Apache volume";
245 +       if ( $HOST ) {
246 +               print " for $HOST";
247 +       }
248 +       print "\n";
249         print "graph_args --base 1000\n";
250         print "graph_vlabel bytes per \${graph_period}\n";
251         print "graph_category apache\n";
252 diff -urNp munin-2.0.25.orig/plugins/node.d/bind9.in munin-2.0.25/plugins/node.d/bind9.in
253 --- munin-2.0.25.orig/plugins/node.d/bind9.in   2014-11-24 21:46:24.000000000 +0000
254 +++ munin-2.0.25/plugins/node.d/bind9.in        2015-09-08 10:05:48.877593251 +0000
255 @@ -53,7 +53,7 @@ GPLv2
256  use strict;
257  
258  my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
259 -my $STATEFILE= "$ENV{MUNIN_PLUGSTATE}/bind9.state";
260 +my $STATEFILE= "@@PLUGSTATE@@/bind9.state";
261  
262  my $OTHER=0;
263  my %IN;
264 @@ -63,7 +63,7 @@ sub get_state {
265          open(Q, ">", $STATEFILE);
266          close(Q);
267      }
268 -    open(Q,"< $STATEFILE") or die ("Cannot open state file");
269 +    open(Q,"< $STATEFILE") or return ("Cannot open state file");
270      while (<Q>) {
271          chomp;
272          my ($q,$n) = split(/\s+/,$_,2);
273 diff -urNp munin-2.0.25.orig/plugins/node.d/courier_.in munin-2.0.25/plugins/node.d/courier_.in
274 --- munin-2.0.25.orig/plugins/node.d/courier_.in        2014-11-24 21:46:24.000000000 +0000
275 +++ munin-2.0.25/plugins/node.d/courier_.in     2015-09-08 10:05:48.877593251 +0000
276 @@ -55,7 +55,7 @@ Unknown
277  COURIER_LOG=${logfile:-/var/log/mail.log}
278  SERVICE=${service:-`basename $0 | sed 's/^courier_//g'`}
279  OFFSET_FILE=${MUNIN_PLUGSTATE}/courier_${SERVICE}.offset
280 -LOGTAIL=${logtail:-/usr/sbin/logtail}
281 +LOGTAIL=${logtail:-`which logtail`}
282  
283  mktempfile () {
284  @@MKTEMP@@
285 diff -urNp munin-2.0.25.orig/plugins/node.d/courier_mta_mailstats.in munin-2.0.25/plugins/node.d/courier_mta_mailstats.in
286 --- munin-2.0.25.orig/plugins/node.d/courier_mta_mailstats.in   2014-11-24 21:46:24.000000000 +0000
287 +++ munin-2.0.25/plugins/node.d/courier_mta_mailstats.in        2015-09-08 10:05:48.878593251 +0000
288 @@ -108,7 +108,9 @@ if(!defined $pos) {
289  
290  if($startsize < $pos) {
291      # Log rotated
292 -    parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
293 +    if (-f $rotlogfile) {
294 +        parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
295 +    }
296      $pos = 0;
297  }
298  
299 diff -urNp munin-2.0.25.orig/plugins/node.d/courier_mta_mailvolume.in munin-2.0.25/plugins/node.d/courier_mta_mailvolume.in
300 --- munin-2.0.25.orig/plugins/node.d/courier_mta_mailvolume.in  2014-11-24 21:46:24.000000000 +0000
301 +++ munin-2.0.25/plugins/node.d/courier_mta_mailvolume.in       2015-09-08 10:05:48.878593251 +0000
302 @@ -98,7 +98,9 @@ if(!defined $pos) {
303  
304  if($startsize < $pos) {
305      # Log rotated
306 -    parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
307 +    if (-f $rotlogfile) {
308 +        parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
309 +    }
310      $pos = 0;
311  }
312  
313 diff -urNp munin-2.0.25.orig/plugins/node.d/cupsys_pages.in munin-2.0.25/plugins/node.d/cupsys_pages.in
314 --- munin-2.0.25.orig/plugins/node.d/cupsys_pages.in    2014-11-24 21:46:24.000000000 +0000
315 +++ munin-2.0.25/plugins/node.d/cupsys_pages.in 2015-09-08 10:05:48.878593251 +0000
316 @@ -100,7 +100,9 @@ if (!defined $pos) {
317  }
318  if ($startsize < $pos) {
319      # Log rotated
320 -    parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
321 +    if (-f $rotlogfile) {
322 +        parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
323 +    }
324      $pos = 0;
325  }
326  
327 @@ -146,7 +148,7 @@ sub parselogfile {
328      while (tell(LOGFILE) < $stop) {
329         my $line = <LOGFILE>;
330         chomp ($line);
331 -       if ($line =~ /^(\S+)\s+\S+\s+\d+\s+\[[^\]]+\]\s+(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/) {
332 +       if ($line =~ /^(\S+)\s+\S+\s+\S+\s+\[[^\]]+\]\s+(\d+)\s+(\d+)\s+(.+)$/) {
333             if(!defined($printers{$1}) && keys(%printers) < $MAXLABEL) {
334                 $printers{$1} += int($2)*int($3);
335             } elsif(defined($printers{$1})) {
336 diff -urNp munin-2.0.25.orig/plugins/node.d/foldingathome_rank.in munin-2.0.25/plugins/node.d/foldingathome_rank.in
337 --- munin-2.0.25.orig/plugins/node.d/foldingathome_rank.in      2014-11-24 21:46:24.000000000 +0000
338 +++ munin-2.0.25/plugins/node.d/foldingathome_rank.in   2015-09-08 10:05:48.879593251 +0000
339 @@ -13,7 +13,7 @@
340  #%# family=contrib
341  #%# capabilities=autoconf
342  
343 -statefile=$MUNIN_PLUGSTATE/plugin-fah_rank.state
344 +statefile=@@PLUGSTATE@@/plugin-fah_rank.state
345  
346  if [ "$1" = "autoconf" ]; then
347      # No real check of anything
348 diff -urNp munin-2.0.25.orig/plugins/node.d/mailman.in munin-2.0.25/plugins/node.d/mailman.in
349 --- munin-2.0.25.orig/plugins/node.d/mailman.in 2014-11-24 21:46:24.000000000 +0000
350 +++ munin-2.0.25/plugins/node.d/mailman.in      2015-09-08 10:05:48.879593251 +0000
351 @@ -38,7 +38,13 @@ $members = 0;
352  # System paths
353  $logfile = $ENV{'logfile'} || "/var/log/mailman/post";
354  $libdir  = $ENV{'libdir'}  || "/var/lib/mailman";
355 -$lister  = $ENV{'lister'}  || "/usr/lib/mailman/bin/list_members";
356 +$lister  = $ENV{'lister'}  || {
357 +       if (-f "/usr/lib64/mailman/bin/list_members") {
358 +               $lister  = "/usr/lib64/mailman/bin/list_members";
359 +       } else {
360 +               $lister  = "/usr/lib/mailman/bin/list_members";
361 +       }
362 +}
363  
364  if (-f "$logfile.0")
365  {
366 @@ -94,7 +100,9 @@ if(!defined $pos) {
367      $startsize = 0;
368  } elsif($startsize < $pos) {
369      # Log rotated
370 -    parseMailmanLog($rotlogfile, $pos, (stat $rotlogfile)[7]);
371 +    if (-f $rotlogfile) {
372 +        parseMailmanLog($rotlogfile, $pos, (stat $rotlogfile)[7]);
373 +    }
374      $pos = 0;
375  }
376  
377 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_.in munin-2.0.25/plugins/node.d/mysql_.in
378 --- munin-2.0.25.orig/plugins/node.d/mysql_.in  2014-11-24 21:46:24.000000000 +0000
379 +++ munin-2.0.25/plugins/node.d/mysql_.in       2015-09-08 10:05:48.881593251 +0000
380 @@ -39,6 +39,7 @@ Non-default example:
381      env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=3306
382      env.mysqluser root
383      env.mysqlpassword geheim
384 +    env.mysqlnosuperpriv 1
385      env.cachenamespace munin_mysql_pri
386    [mysql2_*]
387      env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=13306
388 @@ -156,6 +157,7 @@ my %config = (
389      'user'       => $ENV{'mysqluser'}       || 'root',
390      'password'   => $ENV{'mysqlpassword'}   || '',
391      'cache_namespace' => $ENV{'cachenamespace'} || 'munin_mysql',
392 +    'nosuper'    => $ENV{'mysqlnosuperpriv'} || 0,
393  );
394  
395  
396 @@ -927,8 +929,10 @@ sub update_data {
397  
398      update_variables($dbh);
399      update_innodb($dbh);
400 -    update_master($dbh);
401 -    update_slave($dbh);
402 +    if (!$config{nosuper}) {
403 +       update_master($dbh);
404 +       update_slave($dbh);
405 +    }
406  
407      $shared_memory_cache->set('data', $data);
408  }
409 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_innodb.in munin-2.0.25/plugins/node.d/mysql_innodb.in
410 --- munin-2.0.25.orig/plugins/node.d/mysql_innodb.in    2014-11-24 21:46:24.000000000 +0000
411 +++ munin-2.0.25/plugins/node.d/mysql_innodb.in 2015-09-08 10:05:48.881593251 +0000
412 @@ -1,4 +1,4 @@
413 -#!@@GOODSH@@
414 +#!@@BASH@@
415  
416  : << =cut
417  
418 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_slowqueries.in munin-2.0.25/plugins/node.d/mysql_slowqueries.in
419 --- munin-2.0.25.orig/plugins/node.d/mysql_slowqueries.in       2014-11-24 21:46:24.000000000 +0000
420 +++ munin-2.0.25/plugins/node.d/mysql_slowqueries.in    2015-09-08 10:05:48.882593251 +0000
421 @@ -64,5 +64,5 @@ if [ "$1" = "config" ]; then
422         exit 0
423  fi
424  
425 -/usr/bin/printf "queries.value "
426 +/bin/printf "queries.value "
427  ($MYSQLADMIN $MYSQLOPTS status 2>/dev/null || echo a a a a a a a a U) | awk '{print $9}'
428 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_threads.in munin-2.0.25/plugins/node.d/mysql_threads.in
429 --- munin-2.0.25.orig/plugins/node.d/mysql_threads.in   2014-11-24 21:46:24.000000000 +0000
430 +++ munin-2.0.25/plugins/node.d/mysql_threads.in        2015-09-08 10:05:48.882593251 +0000
431 @@ -74,5 +74,5 @@ if [ "$1" = "config" ]; then
432         exit 0
433  fi
434  
435 -/usr/bin/printf "threads.value "
436 +/bin/printf "threads.value "
437  ($MYSQLADMIN $MYSQLOPTS status 2>/dev/null || echo 'a a a U') | awk '{print $4}'
438 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_.in munin-2.0.25/plugins/node.d/ntp_.in
439 --- munin-2.0.25.orig/plugins/node.d/ntp_.in    2014-11-24 21:46:24.000000000 +0000
440 +++ munin-2.0.25/plugins/node.d/ntp_.in 2015-09-08 10:05:48.883593251 +0000
441 @@ -57,26 +57,26 @@ use Net::DNS;
442  use Net::IP;
443  
444  if ($ARGV[0] and $ARGV[0] eq "autoconf") {
445 -        `ntpq -c help >/dev/null 2>/dev/null`;
446 +        `/usr/sbin/ntpq -c help >/dev/null 2>/dev/null`;
447          if ($CHILD_ERROR eq "0") {
448 -                if (`ntpq -n -c peers | wc -l` > 0) {
449 +                if (`/usr/sbin/ntpq -n -c peers | wc -l` > 0) {
450                          print "yes\n";
451                          exit 0;
452                  } else {
453 -                        print "no (ntpq -p returned no peers)\n";
454 +                        print "no (/usr/sbin/ntpq -p returned no peers)\n";
455                          exit 0;
456                  }
457          } else {
458 -                print "no (ntpq not found)\n";
459 +                print "no (/usr/sbin/ntpq not found)\n";
460                  exit 0;
461          }
462  }
463  
464  if ($ARGV[0] and $ARGV[0] eq "suggest") {
465 -        foreach my $line (`ntpq -c associations`) {
466 +        foreach my $line (`/usr/sbin/ntpq -c associations`) {
467                  if ($line =~ m/^\s*\d+/) {
468                          my (undef, undef, $assid, undef, undef, undef, undef, undef, undef, undef) = split(/\s+/, $line);
469 -                        chomp(my $peerinfo = `ntpq -n -c "readvar $assid srcadr"`);
470 +                        chomp(my $peerinfo = `/usr/sbin/ntpq -n -c "readvar $assid srcadr"`);
471                          $peerinfo =~ s/\R/ /g;
472                          my ($peer_addr) = ($peerinfo =~ m/srcadr=(.*)/);
473                          print $peer_addr, "\n" unless $peer_addr eq "0.0.0.0";
474 @@ -108,7 +108,7 @@ my $srcadr;
475  my $delay;
476  my $offset;
477  my $jitter;
478 -my @associations = `ntpq -c associations`;
479 +my @associations = `/usr/sbin/ntpq -c associations`;
480  
481  foreach my $line (@associations) {
482          if ($line =~ m/^\s*\d+/) {
483 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_kernel_err.in munin-2.0.25/plugins/node.d/ntp_kernel_err.in
484 --- munin-2.0.25.orig/plugins/node.d/ntp_kernel_err.in  2014-11-24 21:46:24.000000000 +0000
485 +++ munin-2.0.25/plugins/node.d/ntp_kernel_err.in       2015-09-08 10:05:48.884593251 +0000
486 @@ -32,7 +32,7 @@ EOF
487  export PATH=/usr/local/sbin:$PATH
488  
489  if [ "$1" = "autoconf" ]; then
490 -    { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
491 +    { /usr/sbin/ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
492      awk 'BEGIN { ev=1; }
493           /^estimated error:/ { ev=0; }
494           END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
495 @@ -51,11 +51,11 @@ fi
496  
497  printf 'ntp_err.value '
498  
499 -if [ $(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
500 +if [ $(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
501  then
502 -    cmd=ntpq
503 +    cmd=/usr/sbin/ntpq
504  else
505 -    cmd=ntpdc
506 +    cmd=/usr/sbin/ntpdc
507  fi
508  
509  $cmd -c kerninfo | awk '/^estimated error:/ { print $3 }'
510 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_freq.in munin-2.0.25/plugins/node.d/ntp_kernel_pll_freq.in
511 --- munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_freq.in     2014-11-24 21:46:24.000000000 +0000
512 +++ munin-2.0.25/plugins/node.d/ntp_kernel_pll_freq.in  2015-09-08 10:05:48.884593251 +0000
513 @@ -39,7 +39,7 @@ EOF
514  export PATH=/usr/local/sbin:$PATH
515  
516  if [ "$1" = "autoconf" ]; then
517 -    { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
518 +    { /usr/sbin/ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
519      awk 'BEGIN { ev=1; }
520           /^pll frequency:/ { ev=0; }
521           END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
522 @@ -65,11 +65,11 @@ fi
523  
524  printf 'ntp_pll_freq.value '
525  
526 -if [ $(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
527 +if [ $(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
528  then
529 -    cmd=ntpq
530 +    cmd=/usr/sbin/ntpq
531  else
532 -    cmd=ntpdc
533 +    cmd=/usr/sbin/ntpdc
534  fi
535  
536  $cmd -c kerninfo | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'
537 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_off.in munin-2.0.25/plugins/node.d/ntp_kernel_pll_off.in
538 --- munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_off.in      2014-11-24 21:46:24.000000000 +0000
539 +++ munin-2.0.25/plugins/node.d/ntp_kernel_pll_off.in   2015-09-08 10:05:48.885593251 +0000
540 @@ -32,7 +32,7 @@ EOF
541  export PATH=/usr/local/sbin:$PATH
542  
543  if [ "$1" = "autoconf" ]; then
544 -    { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
545 +    { /usr/sbin/ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
546      awk 'BEGIN { ev=1; }
547           /^pll offset:/ { ev=0; }
548           END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
549 @@ -51,11 +51,11 @@ fi
550  
551  printf 'ntp_pll_off.value '
552  
553 -if [ $(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
554 +if [ $(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
555  then
556 -    cmd=ntpq
557 +    cmd=/usr/sbin/ntpq
558  else
559 -    cmd=ntpdc
560 +    cmd=/usr/sbin/ntpdc
561  fi
562  
563  $cmd -c kerninfo | awk '/^pll offset:/ { print $3 }'
564 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_offset.in munin-2.0.25/plugins/node.d/ntp_offset.in
565 --- munin-2.0.25.orig/plugins/node.d/ntp_offset.in      2014-11-24 21:46:24.000000000 +0000
566 +++ munin-2.0.25/plugins/node.d/ntp_offset.in   2015-09-08 10:05:48.885593251 +0000
567 @@ -38,9 +38,9 @@ Loosely based on ntp_ plugin, but rework
568  =cut
569  
570  do_autoconf () {
571 -    ntpq -c help >/dev/null 2>&1 || { echo 'no (no ntpq program)'; exit 0; }
572 +    /usr/sbin/ntpq -c help >/dev/null 2>&1 || { echo 'no (no ntpq program)'; exit 0; }
573  
574 -    case "$(ntpq -n -p 2>/dev/null | wc -l)" in
575 +    case "$(/usr/sbin/ntpq -n -p 2>/dev/null | wc -l)" in
576         0)
577              echo 'no (unable to list peers)'
578             exit 0
579 @@ -57,7 +57,7 @@ do_autoconf () {
580  }
581  
582  do_config () {
583 -    syspeer="$(ntpq -n -p | grep '^[*o]')"
584 +    syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
585  
586      set - $syspeer
587  
588 @@ -86,7 +86,7 @@ EOF
589  
590  do_ () {
591      # Fetch operation
592 -    syspeer="$(ntpq -n -p | grep '^[*o]')"
593 +    syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
594  
595      set - $syspeer
596  
597 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_states.in munin-2.0.25/plugins/node.d/ntp_states.in
598 --- munin-2.0.25.orig/plugins/node.d/ntp_states.in      2014-11-24 21:46:24.000000000 +0000
599 +++ munin-2.0.25/plugins/node.d/ntp_states.in   2015-09-08 10:05:48.886593251 +0000
600 @@ -72,10 +72,10 @@ sub make_hash {
601  #  1 63933  931a   yes   yes  none   outlyer    sys_peer  1
602  #  2 63934  943a   yes   yes  none candidate    sys_peer  3
603  
604 -        foreach my $line (`ntpq -c associations`) {
605 +        foreach my $line (`/usr/sbin/ntpq -c associations`) {
606                  if ($line =~ m/^\s*\d+/) {
607                          my (undef, undef, $assid, undef, undef, undef, undef, $condition_str, undef, undef) = split(/\s+/, $line);
608 -                        chomp(my $peerinfo = `ntpq -n -c "readvar $assid srcadr"`);
609 +                        chomp(my $peerinfo = `/usr/sbin/ntpq -n -c "readvar $assid srcadr"`);
610                          $peerinfo =~ s/\s//g;
611                          my ($peer_addr) = ($peerinfo =~ m/srcadr=(.*)/);
612  
613 @@ -125,17 +125,17 @@ sub make_names {
614  }
615  
616  if ($ARGV[0] and $ARGV[0] eq "autoconf") {
617 -        `ntpq -c help >/dev/null 2>/dev/null`;
618 +        `/usr/sbin/ntpq -c help >/dev/null 2>/dev/null`;
619          if ($CHILD_ERROR eq "0") {
620 -                if (`ntpq -n -c peers | wc -l` > 0) {
621 +                if (`/usr/sbin/ntpq -n -c peers | wc -l` > 0) {
622                          print "yes\n";
623                          exit 0;
624                  } else {
625 -                        print "no (ntpq -p returned no peers)\n";
626 +                        print "no (/usr/sbin/ntpq -p returned no peers)\n";
627                          exit 0;
628                  }
629          } else {
630 -                print "no (ntpq not found)\n";
631 +                print "no (/usr/sbin/ntpq not found)\n";
632                  exit 0;
633          }
634  }
635 diff -urNp munin-2.0.25.orig/plugins/node.d/nut_misc.in munin-2.0.25/plugins/node.d/nut_misc.in
636 --- munin-2.0.25.orig/plugins/node.d/nut_misc.in        2014-11-24 21:46:24.000000000 +0000
637 +++ munin-2.0.25/plugins/node.d/nut_misc.in     2015-09-08 10:05:48.886593251 +0000
638 @@ -38,7 +38,8 @@ use strict;
639  my %status;
640  
641  my %config = (
642 -       upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha@127.0.0.1',
643 +       upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha',
644 +       upshost => $ENV{"upshost"} ? $ENV{"upshost"} : '127.0.0.1',
645         upsc => $ENV{"upsc"} ? $ENV{"upsc"} : 'upsc'
646  );
647  
648 @@ -48,11 +49,6 @@ my %graph =  (
649                                 type => 'GAUGE',
650                                 draw => 'LINE2'
651                          },
652 -       'battery_voltage' => {
653 -                               label => 'batt voltage - V',
654 -                               type => 'GAUGE',
655 -                               draw => 'LINE2'
656 -                        },
657         'battery_runtime' => {
658                                 label => 'runtime - min',
659                                 type => 'GAUGE',
660 @@ -76,7 +72,12 @@ my %graph =  (
661  );
662  
663  if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
664 -       print "graph_title UPS Misc - $config{upsname}\n";
665 +       my $s = $config{upsname};
666 +       $s =~ s/_/ /g;
667 +       if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
668 +               $s .= " at $config{upshost}";
669 +       }
670 +       print "graph_title UPS Misc - $s\n";
671         #print "graph_args -l 110\n";
672         #print "graph_vlabel Misc\n";
673         foreach my $key (keys %graph) {
674 @@ -89,7 +90,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq 'c
675  }
676  
677  sub fetch_values {
678 -       my $data = `$config{upsc} $config{upsname}`;
679 +       my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
680         while ($data =~ /([a-z.]+): (.+)\b/g) {
681                 my $label = $1;
682                 my $value = $2;
683 diff -urNp munin-2.0.25.orig/plugins/node.d/nut_volts.in munin-2.0.25/plugins/node.d/nut_volts.in
684 --- munin-2.0.25.orig/plugins/node.d/nut_volts.in       2014-11-24 21:46:24.000000000 +0000
685 +++ munin-2.0.25/plugins/node.d/nut_volts.in    2015-09-08 10:05:48.887593251 +0000
686 @@ -14,7 +14,8 @@ use strict;
687  my %status;
688  
689  my %config = (
690 -       upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha@127.0.0.1',
691 +       upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha',
692 +       upshost => $ENV{"upshost"} ? $ENV{"upshost"} : '127.0.0.1',
693         upsc => $ENV{"upsc"} ? $ENV{"upsc"} : 'upsc'
694  );
695  
696 @@ -24,16 +25,6 @@ my %graph =  (
697                                 type => 'GAUGE',
698                                 draw => 'LINE2'
699                          },
700 -       'input_voltage_maximum' => {
701 -                               label => 'max input seen',
702 -                               type => 'GAUGE',
703 -                               draw => 'LINE1'
704 -                        },
705 -       'input_voltage_minimum' => {
706 -                               label => 'min input seen',
707 -                               type => 'GAUGE',
708 -                               draw => 'LINE1'
709 -                        },
710         'output_voltage' => {
711                                 label => 'output',
712                                 type => 'GAUGE',
713 @@ -42,7 +33,12 @@ my %graph =  (
714  );
715  
716  if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
717 -       print "graph_title UPS Voltages - $config{upsname}\n";
718 +       my $s = $config{upsname};
719 +       $s =~ s/_/ /g;
720 +       if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
721 +               $s .= " at $config{upshost}";
722 +       }
723 +       print "graph_title UPS Voltages - $s\n";
724         print "graph_args -l 115\n";
725         print "graph_vlabel Volts\n";
726         foreach my $key (keys %graph) {
727 @@ -55,7 +51,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq 'c
728  }
729  
730  sub fetch_values {
731 -       my $data = `$config{upsc} $config{upsname}`;
732 +       my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
733         while ($data =~ /([a-z.]+): (.+)\b/g) {
734                 my $label = $1;
735                 my $value = $2;
736 diff -urNp munin-2.0.25.orig/plugins/node.d/perdition.in munin-2.0.25/plugins/node.d/perdition.in
737 --- munin-2.0.25.orig/plugins/node.d/perdition.in       2014-11-24 21:46:24.000000000 +0000
738 +++ munin-2.0.25/plugins/node.d/perdition.in    2015-09-08 10:05:48.887593251 +0000
739 @@ -56,7 +56,7 @@ mktempfile () {
740  # Set the location of the perdition logs
741  PERDITION_LOG=${logfile:-/var/log/perdition.log}
742  OFFSET_FILE=${MUNIN_PLUGSTATE}/perdition.offset
743 -LOGTAIL=${logtail:-/usr/sbin/logtail}
744 +LOGTAIL=${logtail:-`which logtail`}
745  
746  case $1 in
747      autoconf|detect)
748 diff -urNp munin-2.0.25.orig/plugins/node.d/pop_stats.in munin-2.0.25/plugins/node.d/pop_stats.in
749 --- munin-2.0.25.orig/plugins/node.d/pop_stats.in       2014-11-24 21:46:24.000000000 +0000
750 +++ munin-2.0.25/plugins/node.d/pop_stats.in    2015-09-08 10:05:48.888593251 +0000
751 @@ -68,7 +68,9 @@ if (!defined $pos)
752  if ($startsize < $pos)
753  {
754         # Log rotated
755 -       parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
756 +       if (-f $pop{'rotlogfile'}) {
757 +               parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
758 +       }
759         $pos = 0;
760  }
761  
762 diff -urNp munin-2.0.25.orig/plugins/node.d/postgres_scans_.in munin-2.0.25/plugins/node.d/postgres_scans_.in
763 --- munin-2.0.25.orig/plugins/node.d/postgres_scans_.in 2014-11-24 21:46:24.000000000 +0000
764 +++ munin-2.0.25/plugins/node.d/postgres_scans_.in      2015-09-08 10:05:48.888593251 +0000
765 @@ -65,7 +65,6 @@ my $pg = Munin::Plugin::Pgsql->new(
766      vlabel   => 'Scans / sec',
767      basequery =>
768          "SELECT COALESCE(sum(seq_scan),0) AS sequential, COALESCE(sum(idx_scan),0) AS index FROM pg_stat_user_tables",
769 -    paramdatabase => 1,
770      pivotquery    => 1,
771      configquery =>
772          "VALUES ('sequential','Sequential scans'), ('index','Index scans')",
773 diff -urNp munin-2.0.25.orig/plugins/node.d/postgres_tuples_.in munin-2.0.25/plugins/node.d/postgres_tuples_.in
774 --- munin-2.0.25.orig/plugins/node.d/postgres_tuples_.in        2014-11-24 21:46:24.000000000 +0000
775 +++ munin-2.0.25/plugins/node.d/postgres_tuples_.in     2015-09-08 10:05:48.889593251 +0000
776 @@ -74,7 +74,6 @@ my $pg = Munin::Plugin::Pgsql->new(
777                  . " COALESCE(sum(n_tup_del),0) AS deleted FROM pg_stat_user_tables",
778          ],
779      ],
780 -    paramdatabase => 1,
781      pivotquery    => 1,
782      configquery   => [
783          "VALUES ('seqread','Tuples sequentally read'), ('idxfetch','Tuples index fetched'), ('inserted','Tuples inserted'),"
784 diff -urNp munin-2.0.25.orig/plugins/node.d/slapd_.in munin-2.0.25/plugins/node.d/slapd_.in
785 --- munin-2.0.25.orig/plugins/node.d/slapd_.in  2014-11-24 21:46:24.000000000 +0000
786 +++ munin-2.0.25/plugins/node.d/slapd_.in       2015-09-08 10:05:48.890593251 +0000
787 @@ -37,7 +37,7 @@ use vars qw ( $config $param $act $scope
788  
789  # Change these to reflect your LDAP ACL. The given DN must have
790  # read access to the Monitor branch.
791 -my $basedn = "cn=Monitor";
792 +my $basedn = ($ENV{'basedn'} || "cn=Monitor");
793  my $server = ($ENV{'server'} || 'localhost');
794  my $userdn = ($ENV{'binddn'} || '');
795  my $userpw = ($ENV{'bindpw'} || '');
796 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/iostat.in munin-2.0.25/plugins/node.d.linux/iostat.in
797 --- munin-2.0.25.orig/plugins/node.d.linux/iostat.in    2014-11-24 21:46:24.000000000 +0000
798 +++ munin-2.0.25/plugins/node.d.linux/iostat.in 2015-09-08 10:05:55.475593251 +0000
799 @@ -173,7 +173,7 @@ sub fetch_detailed() {
800                 if ($tmpnam =~ /\d+$/ and !$include_numbered) {
801                     # Special case for devices like cXdXpX,
802                     # like the cciss driver
803 -                   next unless $tmpnam =~ /\/c\d+d\d+$/
804 +                   next unless $tmpnam =~ /\/.*d\d+$/
805                 }
806                 next unless grep { $_ } @fields;
807  
808 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/ip_.in munin-2.0.25/plugins/node.d.linux/ip_.in
809 --- munin-2.0.25.orig/plugins/node.d.linux/ip_.in       2014-11-24 21:46:24.000000000 +0000
810 +++ munin-2.0.25/plugins/node.d.linux/ip_.in    2015-09-08 10:05:55.476593251 +0000
811 @@ -127,14 +127,18 @@ case $IP in
812          # This is a fun hack to make the plugin ip6 compatible.
813          # Suggested in ticket #439 by "jodal".
814          eval 'iptables() {
815 -            ip6tables "$@"
816 +            /usr/sbin/ip6tables "$@"
817 +        }'
818 +        ;;
819 +    *) eval 'iptables() {
820 +            /usr/sbin/iptables "$@"
821          }'
822          ;;
823  esac
824  
825  if [[ "$1" == "autoconf" ]]; then
826      if [[ -r /proc/net/dev ]]; then
827 -        if ! iptables -L ${INPUT} -v -n -x >/dev/null 2>/dev/null; then
828 +        if ! /usr/sbin/iptables -L ${INPUT} -v -n -x >/dev/null 2>/dev/null; then
829              echo "no (could not run iptables as user $(whoami))"
830              exit 0
831          else
832 @@ -147,10 +151,10 @@ if [[ "$1" == "autoconf" ]]; then
833      fi
834  fi
835  
836 -if [[ "$1" == "suggest" ]]; then
837 -    iptables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$8 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
838 -    if [[ -x /sbin/ip6tables ]]; then
839 -        ip6tables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
840 +if [ "$1" = "suggest" ]; then
841 +    /usr/sbin/iptables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$8 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
842 +    if [[ -x /usr/sbin/ip6tables ]]; then
843 +        /usr/sbin/ip6tables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
844      fi
845      exit 0
846  fi
847 @@ -183,5 +187,5 @@ fi;
848  
849  # Escape .'s so they don't match _everything_?
850  IP=$(echo $IP | sed 's~\.~\\.~g')
851 -iptables -L ${INPUT} -v -n -x   | awk "/$IP"'[ /]/ { print "in.value " $2; exit 0; }'
852 -iptables -L ${OUTPUT} -v -n -x  | awk "/$IP"'[ /]/ { print "out.value " $2; exit 0; }'
853 +/usr/sbin/iptables -L ${INPUT} -v -n -x   | awk "/$IP"'[ \/]/ { print "in.value " $2; exit 0; }'
854 +/usr/sbin/iptables -L ${OUTPUT} -v -n -x  | awk "/$IP"'[ \/]/ { print "out.value " $2; exit 0; }'
855 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/load.in munin-2.0.25/plugins/node.d.linux/load.in
856 --- munin-2.0.25.orig/plugins/node.d.linux/load.in      2014-11-24 21:46:24.000000000 +0000
857 +++ munin-2.0.25/plugins/node.d.linux/load.in   2015-09-08 10:05:55.476593251 +0000
858 @@ -59,20 +59,20 @@ if [ "$1" = "config" ]; then
859          # one machine answer for several)
860  
861          # The title of the graph
862 -        echo 'graph_title Load average'
863 +        echo "graph_title Load average"
864          # Arguments to "rrdtool graph". In this case, tell it that the
865          # lower limit of the graph is '0', and that 1k=1000 (not 1024)
866 -        echo 'graph_args --base 1000 -l 0'
867 +        echo "graph_args --base 1000 -l 0"
868          # The Y-axis label
869 -        echo 'graph_vlabel load'
870 +        echo "graph_vlabel load"
871          # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
872          # 420 milliload)
873 -        echo 'graph_scale no'
874 +        echo "graph_scale no"
875          # Graph category. Defaults to 'other'
876 -        echo 'graph_category system'
877 +        echo "graph_category system"
878          # The fields. "label" is used in the legend. "label" is the only
879          # required subfield.
880 -        echo 'load.label load'
881 +        echo "load.label load"
882          # These two read the environment for warning values for the field
883          # "load".  If "load_warning" or "warning" aren't set in the
884          # environment, no warning levels are set.  Likewise for "load_critical"
885 @@ -82,8 +82,8 @@ if [ "$1" = "config" ]; then
886          # This one is purely to add an explanation to the web page. The first
887          # one is for the graph itself, while the second one is for the field
888          # "load".
889 -        echo 'graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").'
890 -        echo 'load.info 5 minute load average'
891 +        echo "graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run \"immediately\")."
892 +        echo "load.info 5 minute load average"
893  
894          # Last, if run with the "config"-parameter, quit here (don't
895          # display any data)
896 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/nfs_client.in munin-2.0.25/plugins/node.d.linux/nfs_client.in
897 --- munin-2.0.25.orig/plugins/node.d.linux/nfs_client.in        2014-11-24 21:46:24.000000000 +0000
898 +++ munin-2.0.25/plugins/node.d.linux/nfs_client.in     2015-09-08 10:05:55.477593251 +0000
899 @@ -31,7 +31,7 @@ NFS=/proc/net/rpc/nfs
900  proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
901  
902  if [ "$1" = "autoconf" ]; then
903 -       if [ -f "$NFS" ]; then
904 +       if [ -r "$NFS" ]; then
905                 echo yes
906                 exit 0
907         else
908 @@ -51,11 +51,66 @@ if [ "$1" = "config" ]; then
909         exit 0
910  fi
911  
912 -awk '/proc3/ {
913 -    split("'"$proc"'", names)
914 -    split($0,values)
915 -    for (e in names) {
916 -        printf("%s.value %d\n", names[++i], values[i+3]);
917 -    }
918 +awk '/proc2/ {
919 +       nfs_getattr+=$4
920 +       nfs_setattr+=$5
921 +       nfs_lookup+=$6
922 +       nfs_readlink+=$7
923 +       nfs_read+=$8
924 +       nfs_write+=$9
925 +       nfs_create+=$10
926 +       nfs_mkdir+=$11
927 +       nfs_symlink+=$12
928 +       nfs_remove+=$13
929 +       nfs_rmdir+=$14
930 +       nfs_rename+=$15
931 +       nfs_link+=$16
932 +       nfs_readdir+=$17
933 +       nfs_fsstat+=$18
934 +}
935 +/proc[34]/ {
936 +       nfs_getattr+=$4
937 +       nfs_setattr+=$5
938 +       nfs_lookup+=$6
939 +       nfs_access+=$7
940 +       nfs_readlink+=$8
941 +       nfs_read+=$9
942 +       nfs_write+=$10
943 +       nfs_create+=$11
944 +       nfs_mkdir+=$12
945 +       nfs_symlink+=$13
946 +       nfs_mknod+=$14
947 +       nfs_remove+=$15
948 +       nfs_rmdir+=$16
949 +       nfs_rename+=$17
950 +       nfs_link+=$18
951 +       nfs_readdir+=$19
952 +       nfs_readdirplus+=$20
953 +       nfs_fsstat+=$21
954 +       nfs_fsinfo+=$22
955 +       nfs_pathconf+=$23
956 +       nfs_commit+=$24
957 +}
958 +END {
959 +       print "getattr.value " nfs_getattr
960 +       print "setattr.value " nfs_setattr
961 +       print "lookup.value " nfs_lookup
962 +       print "access.value " nfs_access
963 +       print "readlink.value " nfs_readlink
964 +       print "read.value " nfs_read
965 +       print "write.value " nfs_write
966 +       print "create.value " nfs_create
967 +       print "mkdir.value " nfs_mkdir
968 +       print "symlink.value " nfs_symlink
969 +       print "mknod.value " nfs_mknod
970 +       print "remove.value " nfs_remove
971 +       print "rmdir.value " nfs_rmdir
972 +       print "rename.value " nfs_rename
973 +       print "link.value " nfs_link
974 +       print "readdir.value " nfs_readdir
975 +       print "readdirplus.value " nfs_readdirplus
976 +       print "fsstat.value " nfs_fsstat
977 +       print "fsinfo.value " nfs_fsinfo
978 +       print "pathconf.value " nfs_pathconf
979 +       print "commit.value " nfs_commit
980  }' $NFS
981 -
982 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/nfsd.in munin-2.0.25/plugins/node.d.linux/nfsd.in
983 --- munin-2.0.25.orig/plugins/node.d.linux/nfsd.in      2014-11-24 21:46:24.000000000 +0000
984 +++ munin-2.0.25/plugins/node.d.linux/nfsd.in   2015-09-08 10:05:55.477593251 +0000
985 @@ -31,7 +31,7 @@ NFSD=/proc/net/rpc/nfsd
986  proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
987  
988  if [ "$1" = "autoconf" ]; then
989 -       if [ -f "$NFSD" ]; then
990 +       if [ -r "$NFSD" ]; then
991                 echo yes
992                 exit 0
993         else
994 @@ -51,9 +51,66 @@ if [ "$1" = "config" ]; then
995         exit 0
996  fi
997  
998 -awk '/proc3/ {
999 -    split("'"$proc"'", names)
1000 -    split($0,values)
1001 -    for (e in names)
1002 -        printf("%s.value %d\n", names[++i], values[i+3]);
1003 -  }' $NFSD
1004 +awk '/proc2/ {
1005 +       nfs_getattr+=$4
1006 +       nfs_setattr+=$5
1007 +       nfs_lookup+=$6
1008 +       nfs_readlink+=$7
1009 +       nfs_read+=$8
1010 +       nfs_write+=$9
1011 +       nfs_create+=$10
1012 +       nfs_mkdir+=$11
1013 +       nfs_symlink+=$12
1014 +       nfs_remove+=$13
1015 +       nfs_rmdir+=$14
1016 +       nfs_rename+=$15
1017 +       nfs_link+=$16
1018 +       nfs_readdir+=$17
1019 +       nfs_fsstat+=$18
1020 +}
1021 +/proc[34]/ {
1022 +       nfs_getattr+=$4
1023 +       nfs_setattr+=$5
1024 +       nfs_lookup+=$6
1025 +       nfs_access+=$7
1026 +       nfs_readlink+=$8
1027 +       nfs_read+=$9
1028 +       nfs_write+=$10
1029 +       nfs_create+=$11
1030 +       nfs_mkdir+=$12
1031 +       nfs_symlink+=$13
1032 +       nfs_mknod+=$14
1033 +       nfs_remove+=$15
1034 +       nfs_rmdir+=$16
1035 +       nfs_rename+=$17
1036 +       nfs_link+=$18
1037 +       nfs_readdir+=$19
1038 +       nfs_readdirplus+=$20
1039 +       nfs_fsstat+=$21
1040 +       nfs_fsinfo+=$22
1041 +       nfs_pathconf+=$23
1042 +       nfs_commit+=$24
1043 +}
1044 +END {
1045 +       print "getattr.value " nfs_getattr
1046 +       print "setattr.value " nfs_setattr
1047 +       print "lookup.value " nfs_lookup
1048 +       print "access.value " nfs_access
1049 +       print "readlink.value " nfs_readlink
1050 +       print "read.value " nfs_read
1051 +       print "write.value " nfs_write
1052 +       print "create.value " nfs_create
1053 +       print "mkdir.value " nfs_mkdir
1054 +       print "symlink.value " nfs_symlink
1055 +       print "mknod.value " nfs_mknod
1056 +       print "remove.value " nfs_remove
1057 +       print "rmdir.value " nfs_rmdir
1058 +       print "rename.value " nfs_rename
1059 +       print "link.value " nfs_link
1060 +       print "readdir.value " nfs_readdir
1061 +       print "readdirplus.value " nfs_readdirplus
1062 +       print "fsstat.value " nfs_fsstat
1063 +       print "fsinfo.value " nfs_fsinfo
1064 +       print "pathconf.value " nfs_pathconf
1065 +       print "commit.value " nfs_commit
1066 +}' $NFSD
1067 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/vlan_inetuse_.in munin-2.0.25/plugins/node.d.linux/vlan_inetuse_.in
1068 --- munin-2.0.25.orig/plugins/node.d.linux/vlan_inetuse_.in     2014-11-24 21:46:24.000000000 +0000
1069 +++ munin-2.0.25/plugins/node.d.linux/vlan_inetuse_.in  2015-09-08 10:05:55.477593251 +0000
1070 @@ -37,8 +37,8 @@ my %contraries = ("dpt" => "spt", "spt"
1071  my %in_octets = ();
1072  my %out_octets = ();
1073  
1074 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-in |") or 
1075 -       die "Could not run iptables: $!\n";
1076 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-in |") or 
1077 +       die "Could not run /usr/sbin/iptables: $!\n";
1078  while (<IN>)
1079  {
1080         if (/^\s*\d+\s+(\d+)  +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1081 @@ -49,10 +49,10 @@ while (<IN>)
1082         }
1083  }
1084  close IN;
1085 -die "Error running iptables. Dying\n" if $?;
1086 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1087  
1088 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-out |") or 
1089 -       die "Could not run iptables: $!\n";
1090 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-out |") or 
1091 +       die "Could not run /usr/sbin/iptables: $!\n";
1092  while (<IN>)
1093  {
1094         if (/^\s*\d+\s+(\d+)  +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1095 @@ -67,7 +67,7 @@ while (<IN>)
1096         }
1097  }
1098  close IN;
1099 -die "Error running iptables. Dying\n" if $?;
1100 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1101  
1102  if ($ARGV[0] and $ARGV[0] eq "config")
1103  {
1104 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/vlan_linkuse_.in munin-2.0.25/plugins/node.d.linux/vlan_linkuse_.in
1105 --- munin-2.0.25.orig/plugins/node.d.linux/vlan_linkuse_.in     2014-11-24 21:46:24.000000000 +0000
1106 +++ munin-2.0.25/plugins/node.d.linux/vlan_linkuse_.in  2015-09-08 10:05:55.477593251 +0000
1107 @@ -29,8 +29,8 @@ my %contraries = ("dpt" => "spt", "spt"
1108  my %in_octets = ();
1109  my %out_octets = ();
1110  
1111 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-in |") or 
1112 -       die "Could not run iptables: $!\n";
1113 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-in |") or 
1114 +       die "Could not run /usr/sbin/iptables: $!\n";
1115  while (<IN>)
1116  {
1117         if (/^\s*\d+\s+(\d+)  +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1118 @@ -58,10 +58,10 @@ while (<IN>)
1119         }
1120  }
1121  close IN;
1122 -die "Error running iptables. Dying\n" if $?;
1123 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1124  
1125 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-out |") or 
1126 -       die "Could not run iptables: $!\n";
1127 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-out |") or 
1128 +       die "Could not run /usr/sbin/iptables: $!\n";
1129  while (<IN>)
1130  {
1131         if (/^\s*\d+\s+(\d+)  +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1132 @@ -84,5 +84,5 @@ while (<IN>)
1133         }
1134  }
1135  close IN;
1136 -die "Error running iptables. Dying\n" if $?;
1137 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1138  # vim:syntax=perl
1139 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/vserver_resources.in munin-2.0.25/plugins/node.d.linux/vserver_resources.in
1140 --- munin-2.0.25.orig/plugins/node.d.linux/vserver_resources.in 2014-11-24 21:46:24.000000000 +0000
1141 +++ munin-2.0.25/plugins/node.d.linux/vserver_resources.in      2015-09-08 10:05:55.478593251 +0000
1142 @@ -245,6 +245,12 @@ if [ "$1" = "config" ]; then
1143             echo 'graph_vlabel ANON pages'
1144             echo 'graph_info Shows anonymous memory (human readable) used by each vserver.'
1145             ;;
1146 +       RMAP)
1147 +           echo 'graph_title Mapped memory used by vserver'
1148 +           echo 'graph_args --base 1024k -l 0'
1149 +           echo 'graph_vlabel RMAP pages'
1150 +           echo 'graph_info Shows mapped memory (human readable) used by each vserver.'
1151 +           ;;
1152         FILES)
1153             echo 'graph_title Files used by vserver'
1154             echo 'graph_args --base 1024k -l 0'
1155 @@ -281,6 +287,30 @@ if [ "$1" = "config" ]; then
1156             echo 'graph_vlabel SHM pages'
1157             echo 'graph_info Shows shared memory (human readable) used by each vserver.'
1158             ;;
1159 +       SEMA)
1160 +           echo 'graph_title Semaphore arrays used by vserver'
1161 +           echo 'graph_args --base 1024k -l 0'
1162 +           echo 'graph_vlabel Semaphore arrays'
1163 +           echo 'graph_info Shows semaphore arrays used by each vserver.'
1164 +           ;;
1165 +       SEMS)
1166 +           echo 'graph_title Semaphores used by vserver'
1167 +           echo 'graph_args --base 1024k -l 0'
1168 +           echo 'graph_vlabel Semaphores'
1169 +           echo 'graph_info Shows semaphores used by each vserver.'
1170 +           ;;
1171 +       DENT)
1172 +           echo 'graph_title dentry structs used by vserver'
1173 +           echo 'graph_args --base 1024k -l 0'
1174 +           echo 'graph_vlabel dentry structs'
1175 +           echo 'graph_info Shows dentry structs used by each vserver.'
1176 +           ;;
1177 +       ALL)
1178 +           echo 'graph_title Resources used by vserver'
1179 +           echo 'graph_args --base 1024k -l 0'
1180 +           echo 'graph_vlabel Resources'
1181 +           echo 'graph_info Shows rsources used by each vserver.'
1182 +           ;;
1183         *)
1184             echo "$RESOURCE not defined."
1185             exit 1
1186 @@ -299,53 +329,108 @@ if [ "$1" = "config" ]; then
1187  
1188         case "$RESOURCE" in
1189             PROC)
1190 -               echo "$NAME.label $LABEL: processes"
1191 -               echo "$NAME.info Number of processes used by $LABEL."
1192 +               echo "${NAME}_PROC.label $LABEL: processes"
1193 +               echo "${NAME}_PROC.info Number of processes used by $LABEL."
1194                 ;;
1195             VM)
1196 -               echo "$NAME.label $LABEL: Virtual memory"
1197 -               echo "$NAME.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1198 -               echo "$NAME.cdef $NAME,$pagesize,*"
1199 +               echo "${NAME}_VM.label $LABEL: Virtual memory"
1200 +               echo "${NAME}_VM.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1201 +               echo "${NAME}_VM.cdef ${NAME}_VM,$pagesize,*"
1202                 ;;
1203             VML)
1204 -               echo "$NAME.label $LABEL: Locked memory"
1205 -               echo "$NAME.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1206 -               echo "$NAME.cdef $NAME,$pagesize,*"
1207 +               echo "${NAME}_VML.label $LABEL: Locked memory"
1208 +               echo "${NAME}_VML.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1209 +               echo "${NAME}_VML.cdef ${NAME}_VML,$pagesize,*"
1210                 ;;
1211             RSS)
1212 -               echo "$NAME.label $LABEL: Resident set size"
1213 -               echo "$NAME.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1214 -               echo "$NAME.cdef $NAME,$pagesize,*"
1215 +               echo "${NAME}_RSS.label $LABEL: Resident set size"
1216 +               echo "${NAME}_RSS.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1217 +               echo "${NAME}_RSS.cdef ${NAME}_RSS,$pagesize,*"
1218                 ;;
1219             ANON)
1220 -               echo "$NAME.label $LABEL: Anonymous memory"
1221 -               echo "$NAME.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1222 -               echo "$NAME.cdef $NAME,$pagesize,*"
1223 +               echo "${NAME}_ANON.label $LABEL: Anonymous memory"
1224 +               echo "${NAME}_ANON.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1225 +               echo "${NAME}_ANON.cdef ${NAME}_ANON,$pagesize,*"
1226 +               ;;
1227 +           RMAP)
1228 +               echo "${NAME}_RMAP.label $LABEL: Mapped memory"
1229 +               echo "${NAME}_RMAP.info Size of mapped memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1230 +               echo "${NAME}_RMAP.cdef ${NAME}_RMAP,$pagesize,*"
1231                 ;;
1232             FILES)
1233 -               echo "$NAME.label $LABEL: Files"
1234 -               echo "$NAME.info Number of files used by $LABEL."
1235 +               echo "${NAME}_FILES.label $LABEL: Files"
1236 +               echo "${NAME}_FILES.info Number of files used by $LABEL."
1237                 ;;
1238             OFD)
1239 -               echo "$NAME.label $LABEL: Open filedescriptors"
1240 -               echo "$NAME.info Number of open filedescriptors used by $LABEL."
1241 +               echo "${NAME}_OFD.label $LABEL: Open filedescriptors"
1242 +               echo "${NAME}_OFD.info Number of open filedescriptors used by $LABEL."
1243                 ;;
1244             LOCKS)
1245 -               echo "$NAME.label $LABEL: Locks"
1246 -               echo "$NAME.info Number of locks used by $LABEL."
1247 +               echo "${NAME}_LOCKS.label $LABEL: Locks"
1248 +               echo "${NAME}_LOCKS.info Number of locks used by $LABEL."
1249                 ;;
1250             SOCK)
1251 -               echo "$NAME.label $LABEL: Sockets"
1252 -               echo "$NAME.info Number of sockets used by $LABEL."
1253 +               echo "${NAME}_SOCK.label $LABEL: Sockets"
1254 +               echo "${NAME}_SOCK.info Number of sockets used by $LABEL."
1255                 ;;
1256             MSGQ)
1257 -               echo "$NAME.label $LABEL: Message queues"
1258 -               echo "$NAME.info Number of message queues used by $LABEL."
1259 +               echo "${NAME}_MSGQ.label $LABEL: Message queues"
1260 +               echo "${NAME}_MSGQ.info Number of message queues used by $LABEL."
1261                 ;;
1262             SHM)
1263 -               echo "$NAME.label $LABEL: Shared memory"
1264 -               echo "$NAME.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1265 -               echo "$NAME.cdef $1,$pagesize,*"
1266 +               echo "${NAME}_SHM.label $LABEL: Shared memory"
1267 +               echo "${NAME}_SHM.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1268 +               echo "${NAME}_SHM.cdef ${NAME}_SHM,$pagesize,*"
1269 +               ;;
1270 +           SEMA)
1271 +               echo "${NAME}_SEMA.label $LABEL: Semaphore arrays"
1272 +               echo "${NAME}_SEMA.info Number of semaphore arrays used by $LABEL."
1273 +               ;;
1274 +           SEMS)
1275 +               echo "${NAME}_SEMS.label $LABEL: Semaphores"
1276 +               echo "${NAME}_SEMS.info Number of semaphores used by $LABEL."
1277 +               ;;
1278 +           DENT)
1279 +               echo "${NAME}_DENT.label $LABEL: dentry structs"
1280 +               echo "${NAME}_DENT.info Number of dentries used by $LABEL."
1281 +               ;;
1282 +           ALL)
1283 +               echo "${NAME}_PROC.label $LABEL: processes"
1284 +               echo "${NAME}_PROC.info Number of processes used by $LABEL."
1285 +               echo "${NAME}_VM.label $LABEL: Virtual memory"
1286 +               echo "${NAME}_VM.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1287 +               echo "${NAME}_VM.cdef ${NAME}_VM,$pagesize,*"
1288 +               echo "${NAME}_VML.label $LABEL: Locked memory"
1289 +               echo "${NAME}_VML.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1290 +               echo "${NAME}_VML.cdef ${NAME}_VML,$pagesize,*"
1291 +               echo "${NAME}_RSS.label $LABEL: Resident set size"
1292 +               echo "${NAME}_RSS.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1293 +               echo "${NAME}_RSS.cdef ${NAME}_RSS,$pagesize,*"
1294 +               echo "${NAME}_ANON.label $LABEL: Anonymous memory"
1295 +               echo "${NAME}_ANON.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1296 +               echo "${NAME}_ANON.cdef ${NAME}_ANON,$pagesize,*"
1297 +               echo "${NAME}_RMAP.label $LABEL: Mapped memory"
1298 +               echo "${NAME}_RMAP.info Size of mapped memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1299 +               echo "${NAME}_RMAP.cdef ${NAME}_RMAP,$pagesize,*"
1300 +               echo "${NAME}_FILES.label $LABEL: Files"
1301 +               echo "${NAME}_FILES.info Number of files used by $LABEL."
1302 +               echo "${NAME}_OFD.label $LABEL: Open filedescriptors"
1303 +               echo "${NAME}_OFD.info Number of open filedescriptors used by $LABEL."
1304 +               echo "${NAME}_LOCKS.label $LABEL: Locks"
1305 +               echo "${NAME}_LOCKS.info Number of locks used by $LABEL."
1306 +               echo "${NAME}_SOCK.label $LABEL: Sockets"
1307 +               echo "${NAME}_SOCK.info Number of sockets used by $LABEL."
1308 +               echo "${NAME}_MSGQ.label $LABEL: Message queues"
1309 +               echo "${NAME}_MSGQ.info Number of message queues used by $LABEL."
1310 +               echo "${NAME}_SHM.label $LABEL: Shared memory"
1311 +               echo "${NAME}_SHM.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1312 +               echo "${NAME}_SHM.cdef ${NAME}_SHM,$pagesize,*"
1313 +               echo "${NAME}_SEMA.label $LABEL: Semaphore arrays"
1314 +               echo "${NAME}_SEMA.info Number of semaphore arrays used by $LABEL."
1315 +               echo "${NAME}_SEMS.label $LABEL: Semaphores"
1316 +               echo "${NAME}_SEMS.info Number of semaphores used by $LABEL."
1317 +               echo "${NAME}_DENT.label $LABEL: dentry structs"
1318 +               echo "${NAME}_DENT.info Number of dentries used by $LABEL."
1319                 ;;
1320             *)
1321                 echo "$RESOURCE not defined."
1322 @@ -356,7 +441,7 @@ if [ "$1" = "config" ]; then
1323         if [ ! -z "$LIMITS" -a "$LIMITS" = 1 ]; then
1324             LIMIT=`cat /proc/virtual/$xid/limit | grep $RESOURCE | cut -f4`
1325             if [ ${LIMIT:-0} -gt 0 ]; then
1326 -               echo "$NAME.critical $LIMIT"
1327 +               echo "${NAME}_${RESOURCE}.critical $LIMIT"
1328             fi
1329         fi
1330      done
1331 @@ -367,8 +452,15 @@ fi
1332  for xid in $XIDS ; do
1333      LABEL=`cat /proc/virtual/$xid/$NAMELOC |grep NodeName |cut -f2`
1334      NAME=`echo $LABEL | cut -d. -f1 |  tr '-' '_'`
1335 -    cat /proc/virtual/$xid/limit | awk -v name="${NAME}" -v resource="${RESOURCE}:" \
1336 -       '{ if ( $1 == resource )
1337 -            printf "%s.value %d\n", name, $2 }'
1338 +    if [ $RESOURCE = "ALL" ]; then
1339 +    cat /proc/virtual/$xid/limit | awk -v name="${NAME}" \
1340 +       '{ if ( $1 ~ /[A-Z]*:/ ) {
1341 +            resource = $1 ; gsub(/:/, "", resource);
1342 +            printf "%s_%s.value %d\n", name, resource, $2
1343 +           }}'
1344 +    else
1345 +    cat /proc/virtual/$xid/limit | awk -v name="${NAME}" -v resource="${RESOURCE}" \
1346 +       '{ if ( $1 ~ resource )
1347 +            printf "%s_%s.value %d\n", name, resource, $2 }'
1348 +    fi
1349  done
1350 -