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