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