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