1 diff -urNpa munin-2.0.42.orig/dists/tarball/plugins.conf munin-2.0.42/dists/tarball/plugins.conf
2 --- munin-2.0.42.orig/dists/tarball/plugins.conf 2018-10-11 15:00:48.919033000 +0000
3 +++ munin-2.0.42/dists/tarball/plugins.conf 2018-10-11 15:01:25.723033000 +0000
9 +env.logtail /usr/bin/logtail
12 #env.mysqlopts -u someuser
14 @@ -31,3 +34,128 @@ user root
26 +env.amavislog /var/log/maillog
27 +env.logfile /var/log/maillog
31 +env.logfile /var/log/maillog
39 +env.querystats /var/lib/named/named.stats
44 +#env.squiduser manager
45 +#env.squidpasswd <SECRET>
55 +env.leasefile /var/lib/dhcpd/dhcpd.leases
56 +env.configfile /etc/dhcpd.conf
90 +env.upshost 127.0.0.1
93 +#user root # if you have mode 0000 /vservers dir
96 +# Sane defaults for plugins from MuninExchange
99 +#user root # if you have kernel with grsecurity
101 +env.pname httpd.prefork
106 +env.logfile /var/log/maillog
110 +env.password eAccelerator
111 +env.url http://127.0.0.1/eaccelerator/control.php
115 +env.logfile /var/log/xferlog
119 +env.logfile /var/log/vsftpd.log
123 +env.logfile /var/log/maillog
127 +env.statuslog /var/lib/nagios/status.dat
131 +env.radius_log /var/log/freeradius/radius.log
139 +env.logfile /var/log/openvpn/status.log
143 diff -urNpa munin-2.0.42.orig/plugins/node.d/amavis.in munin-2.0.42/plugins/node.d/amavis.in
144 --- munin-2.0.42.orig/plugins/node.d/amavis.in 2018-10-11 15:00:48.915033000 +0000
145 +++ munin-2.0.42/plugins/node.d/amavis.in 2018-10-11 15:22:35.158033000 +0000
146 @@ -76,7 +76,7 @@ GPLv2
148 AMAVIS_LOG=${amavislog:-/var/log/mail/mail.info}
149 LOGTAIL=${logtail:-logtail}
150 -STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
151 +STATEFILE=@@PLUGSTATE@@/amavis.offset
153 if [ "$1" = "autoconf" ]; then
154 if [ -f "${AMAVIS_LOG}" ] && [ -n "${LOGTAIL}" ] && [ -x "${LOGTAIL}" ] ; then
157 if [ "$1" = "config" ]; then
158 echo 'graph_title Amavis filter statistics'
159 - echo 'graph_vlabel \#'
160 + echo 'graph_vlabel mails'
161 echo 'graph_category antivirus'
162 echo 'virus.label virus'
163 echo 'virus.info Number of viruses caught in email'
164 @@ -117,7 +117,7 @@ virus=U
168 -TEMP_FILE=$(@@MKTEMP@@ munin-amavis.XXXXXX)
169 +TEMP_FILE=$(@@MKTEMP@@ munin-amavis.XXXXXXXXXX)
171 if [ -n "$TEMP_FILE" ] && [ -f "$TEMP_FILE" ]; then
172 if [ "$ARGS" != 0 ]; then
173 diff -urNpa munin-2.0.42.orig/plugins/node.d/apache_accesses.in munin-2.0.42/plugins/node.d/apache_accesses.in
174 --- munin-2.0.42.orig/plugins/node.d/apache_accesses.in 2018-10-11 15:00:48.915033000 +0000
175 +++ munin-2.0.42/plugins/node.d/apache_accesses.in 2018-10-11 15:01:25.724033000 +0000
176 @@ -103,6 +103,7 @@ if (! eval "require LWP::UserAgent;")
178 my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
179 my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
180 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
182 if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
184 @@ -143,7 +144,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
186 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
188 - print "graph_title Apache accesses\n";
189 + print "graph_title Apache accesses";
191 + print " for $HOST";
194 print "graph_args --base 1000\n";
195 print "graph_vlabel accesses / \${graph_period}\n";
196 print "graph_category apache\n";
197 diff -urNpa munin-2.0.42.orig/plugins/node.d/apache_processes.in munin-2.0.42/plugins/node.d/apache_processes.in
198 --- munin-2.0.42.orig/plugins/node.d/apache_processes.in 2018-10-11 15:00:48.915033000 +0000
199 +++ munin-2.0.42/plugins/node.d/apache_processes.in 2018-10-11 15:01:25.724033000 +0000
200 @@ -110,6 +110,7 @@ if (! eval "require LWP::UserAgent;")
202 my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
203 my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
204 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
205 my $SHOWFREE = !exists $ENV{'showfree'} || $ENV{'showfree'};
207 if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
208 @@ -150,7 +151,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
210 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
212 - print "graph_title Apache processes\n";
213 + print "graph_title Apache processes";
215 + print " for $HOST";
218 print "graph_args --base 1000 -l 0\n";
219 print "graph_category apache\n";
220 print "graph_order ";
221 diff -urNpa munin-2.0.42.orig/plugins/node.d/apache_volume.in munin-2.0.42/plugins/node.d/apache_volume.in
222 --- munin-2.0.42.orig/plugins/node.d/apache_volume.in 2018-10-11 15:00:48.915033000 +0000
223 +++ munin-2.0.42/plugins/node.d/apache_volume.in 2018-10-11 15:01:25.724033000 +0000
224 @@ -103,6 +103,7 @@ if (! eval "require LWP::UserAgent;")
226 my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
227 my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
228 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
230 if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
232 @@ -143,7 +144,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
234 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
236 - print "graph_title Apache volume\n";
237 + print "graph_title Apache volume";
239 + print " for $HOST";
242 print "graph_args --base 1000\n";
243 print "graph_vlabel bytes per \${graph_period}\n";
244 print "graph_category apache\n";
245 diff -urNpa munin-2.0.42.orig/plugins/node.d/bind9.in munin-2.0.42/plugins/node.d/bind9.in
246 --- munin-2.0.42.orig/plugins/node.d/bind9.in 2018-10-11 15:00:48.915033000 +0000
247 +++ munin-2.0.42/plugins/node.d/bind9.in 2018-10-11 15:01:25.724033000 +0000
248 @@ -53,7 +53,7 @@ GPLv2
251 my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
252 -my $STATEFILE= "$ENV{MUNIN_PLUGSTATE}/bind9.state";
253 +my $STATEFILE= "@@PLUGSTATE@@/bind9.state";
257 @@ -63,7 +63,7 @@ sub get_state {
258 open(Q, ">", $STATEFILE);
261 - open(Q,"< $STATEFILE") or die ("Cannot open state file");
262 + open(Q,"< $STATEFILE") or return ("Cannot open state file");
265 my ($q,$n) = split(/\s+/,$_,2);
266 diff -urNpa munin-2.0.42.orig/plugins/node.d/courier_.in munin-2.0.42/plugins/node.d/courier_.in
267 --- munin-2.0.42.orig/plugins/node.d/courier_.in 2018-10-11 15:00:48.915033000 +0000
268 +++ munin-2.0.42/plugins/node.d/courier_.in 2018-10-11 15:01:25.725033000 +0000
269 @@ -55,7 +55,7 @@ Unknown
270 COURIER_LOG=${logfile:-/var/log/mail.log}
271 SERVICE=${service:-$(basename "$0" | sed 's/^courier_//g')}
272 OFFSET_FILE=${MUNIN_PLUGSTATE}/courier_${SERVICE}.offset
273 -LOGTAIL=${logtail:-/usr/sbin/logtail}
274 +LOGTAIL=${logtail:-`which logtail`}
278 diff -urNpa munin-2.0.42.orig/plugins/node.d/courier_mta_mailstats.in munin-2.0.42/plugins/node.d/courier_mta_mailstats.in
279 --- munin-2.0.42.orig/plugins/node.d/courier_mta_mailstats.in 2018-10-11 15:00:48.915033000 +0000
280 +++ munin-2.0.42/plugins/node.d/courier_mta_mailstats.in 2018-10-11 15:01:25.725033000 +0000
281 @@ -108,7 +108,9 @@ if(!defined $pos) {
283 if($startsize < $pos) {
285 - parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
286 + if (-f $rotlogfile) {
287 + parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
292 diff -urNpa munin-2.0.42.orig/plugins/node.d/courier_mta_mailvolume.in munin-2.0.42/plugins/node.d/courier_mta_mailvolume.in
293 --- munin-2.0.42.orig/plugins/node.d/courier_mta_mailvolume.in 2018-10-11 15:00:48.915033000 +0000
294 +++ munin-2.0.42/plugins/node.d/courier_mta_mailvolume.in 2018-10-11 15:01:25.725033000 +0000
295 @@ -98,7 +98,9 @@ if(!defined $pos) {
297 if($startsize < $pos) {
299 - parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
300 + if (-f $rotlogfile) {
301 + parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
306 diff -urNpa munin-2.0.42.orig/plugins/node.d/cupsys_pages.in munin-2.0.42/plugins/node.d/cupsys_pages.in
307 --- munin-2.0.42.orig/plugins/node.d/cupsys_pages.in 2018-10-11 15:00:48.915033000 +0000
308 +++ munin-2.0.42/plugins/node.d/cupsys_pages.in 2018-10-11 15:01:25.725033000 +0000
309 @@ -100,7 +100,9 @@ if (!defined $pos) {
311 if ($startsize < $pos) {
313 - parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
314 + if (-f $rotlogfile) {
315 + parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
320 @@ -146,7 +148,7 @@ sub parselogfile {
321 while (tell(LOGFILE) < $stop) {
322 my $line = <LOGFILE>;
324 - if ($line =~ /^(\S+)\s+\S+\s+\d+\s+\[[^\]]+\]\s+(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/) {
325 + if ($line =~ /^(\S+)\s+\S+\s+\S+\s+\[[^\]]+\]\s+(\d+)\s+(\d+)\s+(.+)$/) {
326 if(!defined($printers{$1}) && keys(%printers) < $MAXLABEL) {
327 $printers{$1} += int($2)*int($3);
328 } elsif(defined($printers{$1})) {
329 diff -urNpa munin-2.0.42.orig/plugins/node.d/foldingathome_rank.in munin-2.0.42/plugins/node.d/foldingathome_rank.in
330 --- munin-2.0.42.orig/plugins/node.d/foldingathome_rank.in 2018-10-11 15:00:48.916033000 +0000
331 +++ munin-2.0.42/plugins/node.d/foldingathome_rank.in 2018-10-11 15:01:25.726033000 +0000
336 -statefile=$MUNIN_PLUGSTATE/plugin-fah_rank.state
337 +statefile=@@PLUGSTATE@@/plugin-fah_rank.state
339 if [ "$1" = "config" ]; then
340 echo 'graph_title Folding@Home Rank'
341 diff -urNpa munin-2.0.42.orig/plugins/node.d/mailman.in munin-2.0.42/plugins/node.d/mailman.in
342 --- munin-2.0.42.orig/plugins/node.d/mailman.in 2018-10-11 15:00:48.916033000 +0000
343 +++ munin-2.0.42/plugins/node.d/mailman.in 2018-10-11 15:01:25.726033000 +0000
344 @@ -39,7 +39,13 @@ $members = 0;
346 $logfile = $ENV{'logfile'} || "/var/log/mailman/post";
347 $libdir = $ENV{'libdir'} || "/var/lib/mailman";
348 -$lister = $ENV{'lister'} || "/usr/lib/mailman/bin/list_members";
349 +$lister = $ENV{'lister'} || {
350 + if (-f "/usr/lib64/mailman/bin/list_members") {
351 + $lister = "/usr/lib64/mailman/bin/list_members";
353 + $lister = "/usr/lib/mailman/bin/list_members";
359 @@ -104,7 +110,9 @@ if(!defined $pos) {
361 } elsif($startsize < $pos) {
363 - parseMailmanLog($rotlogfile, $pos, (stat $rotlogfile)[7]);
364 + if (-f $rotlogfile) {
365 + parseMailmanLog($rotlogfile, $pos, (stat $rotlogfile)[7]);
370 diff -urNpa munin-2.0.42.orig/plugins/node.d/mysql_.in munin-2.0.42/plugins/node.d/mysql_.in
371 --- munin-2.0.42.orig/plugins/node.d/mysql_.in 2018-10-11 15:00:48.916033000 +0000
372 +++ munin-2.0.42/plugins/node.d/mysql_.in 2018-10-11 15:01:25.727033000 +0000
373 @@ -50,6 +50,7 @@ Non-default example:
374 env.mysqlconnection DBI:mysql:information_schema;host=127.0.0.1;port=3306
376 env.mysqlpassword geheim
377 + env.mysqlnosuperpriv 1
378 env.cachenamespace munin_mysql_pri
380 env.mysqlconnection DBI:mysql:information_schema;host=127.0.0.1;port=13306
381 @@ -189,6 +190,7 @@ my %config = (
382 'user' => $ENV{'mysqluser'} || 'root',
383 'password' => $ENV{'mysqlpassword'} || '',
384 'cache_namespace' => $ENV{'cachenamespace'} || 'munin_mysql',
385 + 'nosuper' => $ENV{'mysqlnosuperpriv'} || 0,
389 @@ -1111,8 +1113,10 @@ sub update_data {
390 update_variables($dbh);
391 update_plugins($dbh);
393 - update_master($dbh);
394 - update_slave($dbh);
395 + if (!$config{nosuper}) {
396 + update_master($dbh);
397 + update_slave($dbh);
400 $shared_memory_cache->set('data', $data);
401 $shared_memory_cache->set('graphs', nfreeze(\%graphs));
402 diff -urNpa munin-2.0.42.orig/plugins/node.d/mysql_innodb.in munin-2.0.42/plugins/node.d/mysql_innodb.in
403 --- munin-2.0.42.orig/plugins/node.d/mysql_innodb.in 2018-10-11 15:00:48.916033000 +0000
404 +++ munin-2.0.42/plugins/node.d/mysql_innodb.in 2018-10-11 15:01:25.727033000 +0000
411 diff -urNpa munin-2.0.42.orig/plugins/node.d/mysql_slowqueries.in munin-2.0.42/plugins/node.d/mysql_slowqueries.in
412 --- munin-2.0.42.orig/plugins/node.d/mysql_slowqueries.in 2018-10-11 15:00:48.916033000 +0000
413 +++ munin-2.0.42/plugins/node.d/mysql_slowqueries.in 2018-10-11 15:18:55.849033000 +0000
414 @@ -61,6 +61,6 @@ if [ "$1" = "config" ]; then
418 -/usr/bin/printf "queries.value "
419 +/bin/printf "queries.value "
420 # shellcheck disable=SC2086
421 ("$MYSQLADMIN" $MYSQLOPTS status 2>/dev/null || echo a a a a a a a a U) | awk '{print $9}'
422 diff -urNpa munin-2.0.42.orig/plugins/node.d/mysql_threads.in munin-2.0.42/plugins/node.d/mysql_threads.in
423 --- munin-2.0.42.orig/plugins/node.d/mysql_threads.in 2018-10-11 15:00:48.916033000 +0000
424 +++ munin-2.0.42/plugins/node.d/mysql_threads.in 2018-10-11 15:19:08.599033000 +0000
425 @@ -70,6 +70,6 @@ if [ "$1" = "config" ]; then
429 -/usr/bin/printf "threads.value "
430 +/bin/printf "threads.value "
431 # shellcheck disable=SC2086
432 ("$MYSQLADMIN" $MYSQLOPTS status 2>/dev/null || echo 'a a a U') | awk '{print $4}'
433 diff -urNpa munin-2.0.42.orig/plugins/node.d/ntp_.in munin-2.0.42/plugins/node.d/ntp_.in
434 --- munin-2.0.42.orig/plugins/node.d/ntp_.in 2018-10-11 15:00:48.916033000 +0000
435 +++ munin-2.0.42/plugins/node.d/ntp_.in 2018-10-11 15:01:25.728033000 +0000
436 @@ -57,26 +57,26 @@ use Net::DNS;
439 if ($ARGV[0] and $ARGV[0] eq "autoconf") {
440 - `ntpq -c help >/dev/null 2>/dev/null`;
441 + `/usr/sbin/ntpq -c help >/dev/null 2>/dev/null`;
442 if ($CHILD_ERROR eq "0") {
443 - if (`ntpq -n -c peers | wc -l` > 0) {
444 + if (`/usr/sbin/ntpq -n -c peers | wc -l` > 0) {
448 - print "no (ntpq -p returned no peers)\n";
449 + print "no (/usr/sbin/ntpq -p returned no peers)\n";
453 - print "no (ntpq not found)\n";
454 + print "no (/usr/sbin/ntpq not found)\n";
459 if ($ARGV[0] and $ARGV[0] eq "suggest") {
460 - foreach my $line (`ntpq -c associations`) {
461 + foreach my $line (`/usr/sbin/ntpq -c associations`) {
462 if ($line =~ m/^\s*\d+/) {
463 my (undef, undef, $assid, undef, undef, undef, undef, undef, undef, undef) = split(/\s+/, $line);
464 - chomp(my $peerinfo = `ntpq -n -c "readvar $assid srcadr"`);
465 + chomp(my $peerinfo = `/usr/sbin/ntpq -n -c "readvar $assid srcadr"`);
466 $peerinfo =~ s/\R/ /g;
467 my ($peer_addr) = ($peerinfo =~ m/srcadr=(.*)/);
468 print $peer_addr, "\n" unless $peer_addr eq "0.0.0.0";
469 @@ -108,7 +108,7 @@ my $srcadr;
473 -my @associations = `ntpq -c associations`;
474 +my @associations = `/usr/sbin/ntpq -c associations`;
476 foreach my $line (@associations) {
477 if ($line =~ m/^\s*\d+/) {
478 diff -urNpa munin-2.0.42.orig/plugins/node.d/ntp_kernel_err.in munin-2.0.42/plugins/node.d/ntp_kernel_err.in
479 --- munin-2.0.42.orig/plugins/node.d/ntp_kernel_err.in 2018-10-11 15:00:48.916033000 +0000
480 +++ munin-2.0.42/plugins/node.d/ntp_kernel_err.in 2018-10-11 15:21:12.578033000 +0000
481 @@ -32,7 +32,7 @@ EOF
482 export PATH=/usr/local/sbin:$PATH
484 if [ "$1" = "autoconf" ]; then
485 - { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
486 + { /usr/sbin/ntpq -c kerninfo; /usr/sbin/ntpdc -c kerninfo; } 2>/dev/null |
488 /^estimated error:/ { ev=0; }
489 END { if (ev == 0) { print "yes";} else { print "no (command ntpq or ntpdc not found)"; } exit 0; }'
492 printf 'ntp_err.value '
494 -if [ "$(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.')" -ge 427 ]
495 +if [ "$(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.')" -ge 427 ]
497 - ntpq -c kerninfo | awk '/^estimated error:/ { print $3 / 1000 }'
498 + /usr/sbin/ntpq -c kerninfo | awk '/^estimated error:/ { print $3 / 1000 }'
500 - ntpdc -c kerninfo | awk '/^estimated error:/ { print $3 }'
501 + /usr/sbin/ntpdc -c kerninfo | awk '/^estimated error:/ { print $3 }'
503 diff -urNpa munin-2.0.42.orig/plugins/node.d/ntp_kernel_pll_freq.in munin-2.0.42/plugins/node.d/ntp_kernel_pll_freq.in
504 --- munin-2.0.42.orig/plugins/node.d/ntp_kernel_pll_freq.in 2018-10-11 15:00:48.916033000 +0000
505 +++ munin-2.0.42/plugins/node.d/ntp_kernel_pll_freq.in 2018-10-11 15:20:02.850033000 +0000
506 @@ -39,7 +39,7 @@ EOF
507 export PATH=/usr/local/sbin:$PATH
509 if [ "$1" = "autoconf" ]; then
510 - { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
511 + { /usr/sbin/ntpq -c kerninfo; /usr/sbin/ntpdc -c kerninfo; } 2>/dev/null |
513 /^pll frequency:/ { ev=0; }
514 END { if (ev == 0) { print "yes";} else { print "no (command ntpq or ntpdc not found)"; } exit 0; }'
515 @@ -65,11 +65,11 @@ fi
517 printf 'ntp_pll_freq.value '
519 -if [ "$(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.')" -ge 427 ]
520 +if [ "$(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.')" -ge 427 ]
526 + cmd=/usr/sbin/ntpdc
529 $cmd -c kerninfo | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'
530 diff -urNpa munin-2.0.42.orig/plugins/node.d/ntp_kernel_pll_off.in munin-2.0.42/plugins/node.d/ntp_kernel_pll_off.in
531 --- munin-2.0.42.orig/plugins/node.d/ntp_kernel_pll_off.in 2018-10-11 15:00:48.916033000 +0000
532 +++ munin-2.0.42/plugins/node.d/ntp_kernel_pll_off.in 2018-10-11 15:20:26.379033000 +0000
533 @@ -32,7 +32,7 @@ EOF
534 export PATH=/usr/local/sbin:$PATH
536 if [ "$1" = "autoconf" ]; then
537 - { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
538 + { /usr/sbin/ntpq -c kerninfo; /usr/sbin/ntpdc -c kerninfo; } 2>/dev/null |
540 /^pll offset:/ { ev=0; }
541 END { if (ev == 0) { print "yes";} else { print "no (command ntpq or ntpdc not found)"; } exit 0; }'
544 printf 'ntp_pll_off.value '
546 -if [ "$(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.')" -ge 427 ]
547 +if [ "$(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.')" -ge 427 ]
549 - ntpq -c kerninfo | awk '/^pll offset:/ { print $3 / 1000 }'
550 + /usr/sbin/ntpq -c kerninfo | awk '/^pll offset:/ { print $3 / 1000 }'
552 - ntpdc -c kerninfo | awk '/^pll offset:/ { print $3 }'
553 + /usr/sbin/ntpdc -c kerninfo | awk '/^pll offset:/ { print $3 }'
555 diff -urNpa munin-2.0.42.orig/plugins/node.d/ntp_offset.in munin-2.0.42/plugins/node.d/ntp_offset.in
556 --- munin-2.0.42.orig/plugins/node.d/ntp_offset.in 2018-10-11 15:00:48.916033000 +0000
557 +++ munin-2.0.42/plugins/node.d/ntp_offset.in 2018-10-11 15:01:25.729033000 +0000
558 @@ -42,9 +42,9 @@ nodelay=${nodelay:-}
562 - ntpq -c help >/dev/null 2>&1 || { echo 'no (no ntpq program)'; exit 0; }
563 + /usr/sbin/ntpq -c help >/dev/null 2>&1 || { echo 'no (no ntpq program)'; exit 0; }
565 - case "$(ntpq -n -p 2>/dev/null | wc -l)" in
566 + case "$(/usr/sbin/ntpq -n -p 2>/dev/null | wc -l)" in
568 echo 'no (unable to list peers)'
570 @@ -61,7 +61,7 @@ do_autoconf () {
574 - syspeer="$(ntpq -n -p | grep '^[*o]')"
575 + syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
577 # shellcheck disable=SC2086
579 @@ -91,7 +91,7 @@ EOF
583 - syspeer="$(ntpq -n -p | grep '^[*o]')"
584 + syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
586 # shellcheck disable=SC2086
588 diff -urNpa munin-2.0.42.orig/plugins/node.d/ntp_states.in munin-2.0.42/plugins/node.d/ntp_states.in
589 --- munin-2.0.42.orig/plugins/node.d/ntp_states.in 2018-10-11 15:00:48.916033000 +0000
590 +++ munin-2.0.42/plugins/node.d/ntp_states.in 2018-10-11 15:01:25.729033000 +0000
591 @@ -77,10 +77,10 @@ sub make_hash {
592 # 1 63933 931a yes yes none outlier sys_peer 1
593 # 2 63934 943a yes yes none candidate sys_peer 3
595 - foreach my $line (`ntpq -c associations`) {
596 + foreach my $line (`/usr/sbin/ntpq -c associations`) {
597 if ($line =~ m/^\s*\d+/) {
598 my (undef, undef, $assid, undef, undef, undef, undef, $condition_str, undef, undef) = split(/\s+/, $line);
599 - chomp(my $peerinfo = `ntpq -n -c "readvar $assid srcadr"`);
600 + chomp(my $peerinfo = `/usr/sbin/ntpq -n -c "readvar $assid srcadr"`);
601 $peerinfo =~ s/\s//g;
602 my ($peer_addr) = ($peerinfo =~ m/srcadr=(.*)/);
604 @@ -141,17 +141,17 @@ sub make_names {
607 if ($ARGV[0] and $ARGV[0] eq "autoconf") {
608 - `ntpq -c help >/dev/null 2>/dev/null`;
609 + `/usr/sbin/ntpq -c help >/dev/null 2>/dev/null`;
610 if ($CHILD_ERROR eq "0") {
611 - if (`ntpq -n -c peers | wc -l` > 0) {
612 + if (`/usr/sbin/ntpq -n -c peers | wc -l` > 0) {
616 - print "no (ntpq -p returned no peers)\n";
617 + print "no (/usr/sbin/ntpq -p returned no peers)\n";
621 - print "no (ntpq not found)\n";
622 + print "no (/usr/sbin/ntpq not found)\n";
626 diff -urNpa munin-2.0.42.orig/plugins/node.d/nut_misc.in munin-2.0.42/plugins/node.d/nut_misc.in
627 --- munin-2.0.42.orig/plugins/node.d/nut_misc.in 2018-10-11 15:00:48.916033000 +0000
628 +++ munin-2.0.42/plugins/node.d/nut_misc.in 2018-10-11 15:01:25.729033000 +0000
629 @@ -38,7 +38,8 @@ use strict;
633 - upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha@127.0.0.1',
634 + upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha',
635 + upshost => $ENV{"upshost"} ? $ENV{"upshost"} : '127.0.0.1',
636 upsc => $ENV{"upsc"} ? $ENV{"upsc"} : 'upsc'
639 @@ -48,11 +49,6 @@ my %graph = (
643 - 'battery_voltage' => {
644 - label => 'batt voltage - V',
648 'battery_runtime' => {
649 label => 'runtime - min',
651 @@ -76,7 +72,12 @@ my %graph = (
654 if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
655 - print "graph_title UPS Misc - $config{upsname}\n";
656 + my $s = $config{upsname};
658 + if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
659 + $s .= " at $config{upshost}";
661 + print "graph_title UPS Misc - $s\n";
662 #print "graph_args -l 110\n";
663 #print "graph_vlabel Misc\n";
664 foreach my $key (keys %graph) {
665 @@ -89,7 +90,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq 'c
669 - my $data = `$config{upsc} $config{upsname}`;
670 + my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
671 while ($data =~ /([a-z.]+): (.+)\b/g) {
674 diff -urNpa munin-2.0.42.orig/plugins/node.d/nut_volts.in munin-2.0.42/plugins/node.d/nut_volts.in
675 --- munin-2.0.42.orig/plugins/node.d/nut_volts.in 2018-10-11 15:00:48.917033000 +0000
676 +++ munin-2.0.42/plugins/node.d/nut_volts.in 2018-10-11 15:01:25.730033000 +0000
677 @@ -14,7 +14,8 @@ use strict;
681 - upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha@127.0.0.1',
682 + upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha',
683 + upshost => $ENV{"upshost"} ? $ENV{"upshost"} : '127.0.0.1',
684 upsc => $ENV{"upsc"} ? $ENV{"upsc"} : 'upsc'
687 @@ -24,16 +25,6 @@ my %graph = (
691 - 'input_voltage_maximum' => {
692 - label => 'max input seen',
696 - 'input_voltage_minimum' => {
697 - label => 'min input seen',
701 'output_voltage' => {
704 @@ -42,7 +33,12 @@ my %graph = (
707 if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
708 - print "graph_title UPS Voltages - $config{upsname}\n";
709 + my $s = $config{upsname};
711 + if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
712 + $s .= " at $config{upshost}";
714 + print "graph_title UPS Voltages - $s\n";
715 print "graph_args -l 115\n";
716 print "graph_vlabel Volts\n";
717 foreach my $key (keys %graph) {
718 @@ -55,7 +51,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq 'c
722 - my $data = `$config{upsc} $config{upsname}`;
723 + my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
724 while ($data =~ /([a-z.]+): (.+)\b/g) {
727 diff -urNpa munin-2.0.42.orig/plugins/node.d/perdition.in munin-2.0.42/plugins/node.d/perdition.in
728 --- munin-2.0.42.orig/plugins/node.d/perdition.in 2018-10-11 15:00:48.917033000 +0000
729 +++ munin-2.0.42/plugins/node.d/perdition.in 2018-10-11 15:01:25.730033000 +0000
730 @@ -53,7 +53,7 @@ Unknown
731 # Set the location of the perdition logs
732 PERDITION_LOG=${logfile:-/var/log/perdition.log}
733 OFFSET_FILE=${MUNIN_PLUGSTATE}/perdition.offset
734 -LOGTAIL=${logtail:-/usr/sbin/logtail}
735 +LOGTAIL=${logtail:-`which logtail`}
739 diff -urNpa munin-2.0.42.orig/plugins/node.d/pop_stats.in munin-2.0.42/plugins/node.d/pop_stats.in
740 --- munin-2.0.42.orig/plugins/node.d/pop_stats.in 2018-10-11 15:00:48.917033000 +0000
741 +++ munin-2.0.42/plugins/node.d/pop_stats.in 2018-10-11 15:01:25.730033000 +0000
742 @@ -68,7 +68,9 @@ if (!defined $pos)
743 if ($startsize < $pos)
746 - parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
747 + if (-f $pop{'rotlogfile'}) {
748 + parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
753 diff -urNpa munin-2.0.42.orig/plugins/node.d/postgres_scans_.in munin-2.0.42/plugins/node.d/postgres_scans_.in
754 --- munin-2.0.42.orig/plugins/node.d/postgres_scans_.in 2018-10-11 15:00:48.917033000 +0000
755 +++ munin-2.0.42/plugins/node.d/postgres_scans_.in 2018-10-11 15:01:25.730033000 +0000
756 @@ -65,7 +65,6 @@ my $pg = Munin::Plugin::Pgsql->new(
757 vlabel => 'Scans / sec',
759 "SELECT COALESCE(sum(seq_scan),0) AS sequential, COALESCE(sum(idx_scan),0) AS index FROM pg_stat_user_tables",
760 - paramdatabase => 1,
763 "VALUES ('sequential','Sequential scans'), ('index','Index scans')",
764 diff -urNpa munin-2.0.42.orig/plugins/node.d/postgres_tuples_.in munin-2.0.42/plugins/node.d/postgres_tuples_.in
765 --- munin-2.0.42.orig/plugins/node.d/postgres_tuples_.in 2018-10-11 15:00:48.917033000 +0000
766 +++ munin-2.0.42/plugins/node.d/postgres_tuples_.in 2018-10-11 15:01:25.730033000 +0000
767 @@ -74,7 +74,6 @@ my $pg = Munin::Plugin::Pgsql->new(
768 . " COALESCE(sum(n_tup_del),0) AS deleted FROM pg_stat_user_tables",
771 - paramdatabase => 1,
774 "VALUES ('seqread','Tuples sequentally read'), ('idxfetch','Tuples index fetched'), ('inserted','Tuples inserted'),"
775 diff -urNpa munin-2.0.42.orig/plugins/node.d/slapd_.in munin-2.0.42/plugins/node.d/slapd_.in
776 --- munin-2.0.42.orig/plugins/node.d/slapd_.in 2018-10-11 15:00:48.917033000 +0000
777 +++ munin-2.0.42/plugins/node.d/slapd_.in 2018-10-11 15:01:25.730033000 +0000
778 @@ -37,7 +37,7 @@ use vars qw ( $config $param $act $scope
780 # Change these to reflect your LDAP ACL. The given DN must have
781 # read access to the Monitor branch.
782 -my $basedn = "cn=Monitor";
783 +my $basedn = ($ENV{'basedn'} || "cn=Monitor");
784 my $server = ($ENV{'server'} || 'localhost');
785 my $userdn = ($ENV{'binddn'} || '');
786 my $userpw = ($ENV{'bindpw'} || '');
787 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/iostat.in munin-2.0.42/plugins/node.d.linux/iostat.in
788 --- munin-2.0.42.orig/plugins/node.d.linux/iostat.in 2018-10-11 15:00:48.914033000 +0000
789 +++ munin-2.0.42/plugins/node.d.linux/iostat.in 2018-10-11 15:01:25.731033000 +0000
790 @@ -173,7 +173,7 @@ sub fetch_detailed() {
791 if ($tmpnam =~ /\d+$/ and !$include_numbered) {
792 # Special case for devices like cXdXpX,
793 # like the cciss driver
794 - next unless $tmpnam =~ /\/c\d+d\d+$/
795 + next unless $tmpnam =~ /\/.*d\d+$/
797 next unless grep { $_ } @fields;
799 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/ip_.in munin-2.0.42/plugins/node.d.linux/ip_.in
800 --- munin-2.0.42.orig/plugins/node.d.linux/ip_.in 2018-10-11 15:00:48.914033000 +0000
801 +++ munin-2.0.42/plugins/node.d.linux/ip_.in 2018-10-11 15:12:04.650033000 +0000
802 @@ -128,14 +128,14 @@ case $IP in
803 # This is a fun hack to make the plugin ip6 compatible.
804 # Suggested in ticket #439 by "jodal".
807 + /usr/sbin/ip6tables "$@"
812 if [[ "$1" == "autoconf" ]]; then
813 if [[ -r /proc/net/dev ]]; then
814 - if ! iptables -L "$INPUT" -v -n -w -x >/dev/null 2>/dev/null; then
815 + if ! /usr/sbin/iptables -L "$INPUT" -v -n -w -x >/dev/null 2>/dev/null; then
816 echo "no (could not run iptables as user $(whoami))"
819 @@ -148,10 +148,10 @@ if [[ "$1" == "autoconf" ]]; then
823 -if [[ "$1" == "suggest" ]]; then
824 - iptables -L "$INPUT" -v -n -x -w 2>/dev/null | awk --posix '$8 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
825 - if [[ -x /sbin/ip6tables ]]; then
826 - ip6tables -L "$INPUT" -v -n -x -w 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
827 +if [ "$1" == "suggest" ]; then
828 + /usr/sbin/iptables -L "$INPUT" -v -n -x -w 2>/dev/null | awk --posix '$8 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
829 + if [[ -x /usr/sbin/ip6tables ]]; then
830 + /usr/sbin/ip6tables -L "$INPUT" -v -n -x -w 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
834 @@ -185,5 +185,5 @@ fi;
836 # Escape .'s so they don't match _everything_?
837 escaped_ip=${IP//./\\.}
838 -iptables -L "$INPUT" -v -n -x -w | awk "/$escaped_ip"'[ /]/ { print "in.value " $2; exit 0; }'
839 -iptables -L "$OUTPUT" -v -n -x -w | awk "/$escaped_ip"'[ /]/ { print "out.value " $2; exit 0; }'
840 +/usr/sbin/iptables -L "$INPUT" -v -n -x -w | awk "/$escaped_ip"'[ /]/ { print "in.value " $2; exit 0; }'
841 +/usr/sbin/iptables -L "$OUTPUT" -v -n -x -w | awk "/$escaped_ip"'[ /]/ { print "out.value " $2; exit 0; }'
842 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/load.in munin-2.0.42/plugins/node.d.linux/load.in
843 --- munin-2.0.42.orig/plugins/node.d.linux/load.in 2018-10-11 15:00:48.914033000 +0000
844 +++ munin-2.0.42/plugins/node.d.linux/load.in 2018-10-11 15:01:25.731033000 +0000
845 @@ -59,20 +59,20 @@ if [ "$1" = "config" ]; then
846 # one machine answer for several)
848 # The title of the graph
849 - echo 'graph_title Load average'
850 + echo "graph_title Load average"
851 # Arguments to "rrdtool graph". In this case, tell it that the
852 # lower limit of the graph is '0', and that 1k=1000 (not 1024)
853 - echo 'graph_args --base 1000 -l 0'
854 + echo "graph_args --base 1000 -l 0"
856 - echo 'graph_vlabel load'
857 + echo "graph_vlabel load"
858 # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
860 - echo 'graph_scale no'
861 + echo "graph_scale no"
862 # Graph category. Defaults to 'other'
863 - echo 'graph_category system'
864 + echo "graph_category system"
865 # The fields. "label" is used in the legend. "label" is the only
867 - echo 'load.label load'
868 + echo "load.label load"
869 # These two read the environment for warning values for the field
870 # "load". If "load_warning" or "warning" aren't set in the
871 # environment, no warning levels are set. Likewise for "load_critical"
872 @@ -82,8 +82,8 @@ if [ "$1" = "config" ]; then
873 # This one is purely to add an explanation to the web page. The first
874 # one is for the graph itself, while the second one is for the field
876 - echo 'graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").'
877 - echo 'load.info 5 minute load average'
878 + echo "graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run \"immediately\")."
879 + echo "load.info 5 minute load average"
881 # Last, if run with the "config"-parameter, quit here (don't
883 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/nfs_client.in munin-2.0.42/plugins/node.d.linux/nfs_client.in
884 --- munin-2.0.42.orig/plugins/node.d.linux/nfs_client.in 2018-10-11 15:00:48.914033000 +0000
885 +++ munin-2.0.42/plugins/node.d.linux/nfs_client.in 2018-10-11 15:12:43.768033000 +0000
886 @@ -31,7 +31,7 @@ NFS=/proc/net/rpc/nfs
887 proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
889 if [ "$1" = "autoconf" ]; then
890 - if [ -f "$NFS" ]; then
891 + if [ -r "$NFS" ]; then
892 if grep -q proc3 "$NFS"; then
895 @@ -56,11 +56,66 @@ if [ "$1" = "config" ]; then
900 - split("'"$proc"'", names)
903 - printf("%s.value %d\n", names[++i], values[i+3]);
939 + nfs_readdirplus+=$20
946 + print "getattr.value " nfs_getattr
947 + print "setattr.value " nfs_setattr
948 + print "lookup.value " nfs_lookup
949 + print "access.value " nfs_access
950 + print "readlink.value " nfs_readlink
951 + print "read.value " nfs_read
952 + print "write.value " nfs_write
953 + print "create.value " nfs_create
954 + print "mkdir.value " nfs_mkdir
955 + print "symlink.value " nfs_symlink
956 + print "mknod.value " nfs_mknod
957 + print "remove.value " nfs_remove
958 + print "rmdir.value " nfs_rmdir
959 + print "rename.value " nfs_rename
960 + print "link.value " nfs_link
961 + print "readdir.value " nfs_readdir
962 + print "readdirplus.value " nfs_readdirplus
963 + print "fsstat.value " nfs_fsstat
964 + print "fsinfo.value " nfs_fsinfo
965 + print "pathconf.value " nfs_pathconf
966 + print "commit.value " nfs_commit
969 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/nfsd.in munin-2.0.42/plugins/node.d.linux/nfsd.in
970 --- munin-2.0.42.orig/plugins/node.d.linux/nfsd.in 2018-10-11 15:00:48.914033000 +0000
971 +++ munin-2.0.42/plugins/node.d.linux/nfsd.in 2018-10-11 15:13:00.220033000 +0000
972 @@ -31,7 +31,7 @@ NFSD=/proc/net/rpc/nfsd
973 proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
975 if [ "$1" = "autoconf" ]; then
976 - if [ -f "$NFSD" ]; then
977 + if [ -r "$NFSD" ]; then
978 grep -q proc3 "$NFSD"
979 if grep -q proc3 "$NFSD"; then
981 @@ -57,9 +57,66 @@ if [ "$1" = "config" ]; then
986 - split("'"$proc"'", names)
989 - printf("%s.value %d\n", names[++i], values[i+3]);
1025 + nfs_readdirplus+=$20
1032 + print "getattr.value " nfs_getattr
1033 + print "setattr.value " nfs_setattr
1034 + print "lookup.value " nfs_lookup
1035 + print "access.value " nfs_access
1036 + print "readlink.value " nfs_readlink
1037 + print "read.value " nfs_read
1038 + print "write.value " nfs_write
1039 + print "create.value " nfs_create
1040 + print "mkdir.value " nfs_mkdir
1041 + print "symlink.value " nfs_symlink
1042 + print "mknod.value " nfs_mknod
1043 + print "remove.value " nfs_remove
1044 + print "rmdir.value " nfs_rmdir
1045 + print "rename.value " nfs_rename
1046 + print "link.value " nfs_link
1047 + print "readdir.value " nfs_readdir
1048 + print "readdirplus.value " nfs_readdirplus
1049 + print "fsstat.value " nfs_fsstat
1050 + print "fsinfo.value " nfs_fsinfo
1051 + print "pathconf.value " nfs_pathconf
1052 + print "commit.value " nfs_commit
1054 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/vlan_inetuse_.in munin-2.0.42/plugins/node.d.linux/vlan_inetuse_.in
1055 --- munin-2.0.42.orig/plugins/node.d.linux/vlan_inetuse_.in 2018-10-11 15:00:48.915033000 +0000
1056 +++ munin-2.0.42/plugins/node.d.linux/vlan_inetuse_.in 2018-10-11 15:13:31.770033000 +0000
1057 @@ -37,7 +37,7 @@ my %contraries = ("dpt" => "spt", "spt"
1059 my %out_octets = ();
1061 -open (IN, "/sbin/iptables -v -x -w -L $INTERFACE-in |") or
1062 +open (IN, "/usr/sbin/iptables -v -x -w -L $INTERFACE-in |") or
1063 die "Could not run iptables: $!\n";
1066 @@ -51,7 +51,7 @@ while (<IN>)
1068 die "Error running iptables. Dying\n" if $?;
1070 -open (IN, "/sbin/iptables -v -x -w -L $INTERFACE-out |") or
1071 +open (IN, "/usr/sbin/iptables -v -x -w -L $INTERFACE-out |") or
1072 die "Could not run iptables: $!\n";
1075 @@ -67,7 +67,7 @@ while (<IN>)
1079 -die "Error running iptables. Dying\n" if $?;
1080 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1082 if ($ARGV[0] and $ARGV[0] eq "config")
1084 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/vlan_linkuse_.in munin-2.0.42/plugins/node.d.linux/vlan_linkuse_.in
1085 --- munin-2.0.42.orig/plugins/node.d.linux/vlan_linkuse_.in 2018-10-11 15:00:48.915033000 +0000
1086 +++ munin-2.0.42/plugins/node.d.linux/vlan_linkuse_.in 2018-10-11 15:13:55.670033000 +0000
1087 @@ -29,7 +29,7 @@ my %contraries = ("dpt" => "spt", "spt"
1089 my %out_octets = ();
1091 -open (IN, "/sbin/iptables -v -x -w -L $INTERFACE-in |") or
1092 +open (IN, "/usr/sbin/iptables -v -x -w -L $INTERFACE-in |") or
1093 die "Could not run iptables: $!\n";
1096 @@ -60,7 +60,7 @@ while (<IN>)
1098 die "Error running iptables. Dying\n" if $?;
1100 -open (IN, "/sbin/iptables -v -x -w -L $INTERFACE-out |") or
1101 +open (IN, "/usr/sbin/iptables -v -x -w -L $INTERFACE-out |") or
1102 die "Could not run iptables: $!\n";
1105 @@ -84,5 +84,5 @@ while (<IN>)
1109 -die "Error running iptables. Dying\n" if $?;
1110 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1112 diff -urNpa munin-2.0.42.orig/plugins/node.d.linux/vserver_resources.in munin-2.0.42/plugins/node.d.linux/vserver_resources.in
1113 --- munin-2.0.42.orig/plugins/node.d.linux/vserver_resources.in 2018-10-11 15:00:48.915033000 +0000
1114 +++ munin-2.0.42/plugins/node.d.linux/vserver_resources.in 2018-10-11 15:18:05.899033000 +0000
1115 @@ -247,6 +247,12 @@ if [ "$1" = "config" ]; then
1116 echo 'graph_vlabel ANON pages'
1117 echo 'graph_info Shows anonymous memory (human readable) used by each vserver.'
1120 + echo 'graph_title Mapped memory used by vserver'
1121 + echo 'graph_args --base 1024k -l 0'
1122 + echo 'graph_vlabel RMAP pages'
1123 + echo 'graph_info Shows mapped memory (human readable) used by each vserver.'
1126 echo 'graph_title Files used by vserver'
1127 echo 'graph_args --base 1024k -l 0'
1128 @@ -283,6 +289,30 @@ if [ "$1" = "config" ]; then
1129 echo 'graph_vlabel SHM pages'
1130 echo 'graph_info Shows shared memory (human readable) used by each vserver.'
1133 + echo 'graph_title Semaphore arrays used by vserver'
1134 + echo 'graph_args --base 1024k -l 0'
1135 + echo 'graph_vlabel Semaphore arrays'
1136 + echo 'graph_info Shows semaphore arrays used by each vserver.'
1139 + echo 'graph_title Semaphores used by vserver'
1140 + echo 'graph_args --base 1024k -l 0'
1141 + echo 'graph_vlabel Semaphores'
1142 + echo 'graph_info Shows semaphores used by each vserver.'
1145 + echo 'graph_title dentry structs used by vserver'
1146 + echo 'graph_args --base 1024k -l 0'
1147 + echo 'graph_vlabel dentry structs'
1148 + echo 'graph_info Shows dentry structs used by each vserver.'
1151 + echo 'graph_title Resources used by vserver'
1152 + echo 'graph_args --base 1024k -l 0'
1153 + echo 'graph_vlabel Resources'
1154 + echo 'graph_info Shows rsources used by each vserver.'
1157 echo "$RESOURCE not defined."
1159 @@ -301,53 +331,108 @@ if [ "$1" = "config" ]; then
1163 - echo "$NAME.label $LABEL: processes"
1164 - echo "$NAME.info Number of processes used by $LABEL."
1165 + echo "${NAME}_PROC.label $LABEL: processes"
1166 + echo "${NAME}_PROC.info Number of processes used by $LABEL."
1169 - echo "$NAME.label $LABEL: Virtual memory"
1170 - echo "$NAME.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1171 - echo "$NAME.cdef $NAME,$pagesize,*"
1172 + echo "${NAME}_VM.label $LABEL: Virtual memory"
1173 + echo "${NAME}_VM.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1174 + echo "${NAME}_VM.cdef ${NAME}_VM,$pagesize,*"
1177 - echo "$NAME.label $LABEL: Locked memory"
1178 - echo "$NAME.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1179 - echo "$NAME.cdef $NAME,$pagesize,*"
1180 + echo "${NAME}_VML.label $LABEL: Locked memory"
1181 + echo "${NAME}_VML.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1182 + echo "${NAME}_VML.cdef ${NAME}_VML,$pagesize,*"
1185 - echo "$NAME.label $LABEL: Resident set size"
1186 - echo "$NAME.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1187 - echo "$NAME.cdef $NAME,$pagesize,*"
1188 + echo "${NAME}_RSS.label $LABEL: Resident set size"
1189 + echo "${NAME}_RSS.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1190 + echo "${NAME}_RSS.cdef ${NAME}_RSS,$pagesize,*"
1193 - echo "$NAME.label $LABEL: Anonymous memory"
1194 - echo "$NAME.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1195 - echo "$NAME.cdef $NAME,$pagesize,*"
1196 + echo "${NAME}_ANON.label $LABEL: Anonymous memory"
1197 + echo "${NAME}_ANON.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1198 + echo "${NAME}_ANON.cdef ${NAME}_ANON,$pagesize,*"
1201 + echo "${NAME}_RMAP.label $LABEL: Mapped memory"
1202 + echo "${NAME}_RMAP.info Size of mapped memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1203 + echo "${NAME}_RMAP.cdef ${NAME}_RMAP,$pagesize,*"
1206 - echo "$NAME.label $LABEL: Files"
1207 - echo "$NAME.info Number of files used by $LABEL."
1208 + echo "${NAME}_FILES.label $LABEL: Files"
1209 + echo "${NAME}_FILES.info Number of files used by $LABEL."
1212 - echo "$NAME.label $LABEL: Open filedescriptors"
1213 - echo "$NAME.info Number of open filedescriptors used by $LABEL."
1214 + echo "${NAME}_OFD.label $LABEL: Open filedescriptors"
1215 + echo "${NAME}_OFD.info Number of open filedescriptors used by $LABEL."
1218 - echo "$NAME.label $LABEL: Locks"
1219 - echo "$NAME.info Number of locks used by $LABEL."
1220 + echo "${NAME}_LOCKS.label $LABEL: Locks"
1221 + echo "${NAME}_LOCKS.info Number of locks used by $LABEL."
1224 - echo "$NAME.label $LABEL: Sockets"
1225 - echo "$NAME.info Number of sockets used by $LABEL."
1226 + echo "${NAME}_SOCK.label $LABEL: Sockets"
1227 + echo "${NAME}_SOCK.info Number of sockets used by $LABEL."
1230 - echo "$NAME.label $LABEL: Message queues"
1231 - echo "$NAME.info Number of message queues used by $LABEL."
1232 + echo "${NAME}_MSGQ.label $LABEL: Message queues"
1233 + echo "${NAME}_MSGQ.info Number of message queues used by $LABEL."
1236 - echo "$NAME.label $LABEL: Shared memory"
1237 - echo "$NAME.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1238 - echo "$NAME.cdef $1,$pagesize,*"
1239 + echo "${NAME}_SHM.label $LABEL: Shared memory"
1240 + echo "${NAME}_SHM.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1241 + echo "${NAME}_SHM.cdef ${NAME}_SHM,$pagesize,*"
1244 + echo "${NAME}_SEMA.label $LABEL: Semaphore arrays"
1245 + echo "${NAME}_SEMA.info Number of semaphore arrays used by $LABEL."
1248 + echo "${NAME}_SEMS.label $LABEL: Semaphores"
1249 + echo "${NAME}_SEMS.info Number of semaphores used by $LABEL."
1252 + echo "${NAME}_DENT.label $LABEL: dentry structs"
1253 + echo "${NAME}_DENT.info Number of dentries used by $LABEL."
1256 + echo "${NAME}_PROC.label $LABEL: processes"
1257 + echo "${NAME}_PROC.info Number of processes used by $LABEL."
1258 + echo "${NAME}_VM.label $LABEL: Virtual memory"
1259 + echo "${NAME}_VM.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1260 + echo "${NAME}_VM.cdef ${NAME}_VM,$pagesize,*"
1261 + echo "${NAME}_VML.label $LABEL: Locked memory"
1262 + echo "${NAME}_VML.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1263 + echo "${NAME}_VML.cdef ${NAME}_VML,$pagesize,*"
1264 + echo "${NAME}_RSS.label $LABEL: Resident set size"
1265 + echo "${NAME}_RSS.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1266 + echo "${NAME}_RSS.cdef ${NAME}_RSS,$pagesize,*"
1267 + echo "${NAME}_ANON.label $LABEL: Anonymous memory"
1268 + echo "${NAME}_ANON.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1269 + echo "${NAME}_ANON.cdef ${NAME}_ANON,$pagesize,*"
1270 + echo "${NAME}_RMAP.label $LABEL: Mapped memory"
1271 + echo "${NAME}_RMAP.info Size of mapped memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1272 + echo "${NAME}_RMAP.cdef ${NAME}_RMAP,$pagesize,*"
1273 + echo "${NAME}_FILES.label $LABEL: Files"
1274 + echo "${NAME}_FILES.info Number of files used by $LABEL."
1275 + echo "${NAME}_OFD.label $LABEL: Open filedescriptors"
1276 + echo "${NAME}_OFD.info Number of open filedescriptors used by $LABEL."
1277 + echo "${NAME}_LOCKS.label $LABEL: Locks"
1278 + echo "${NAME}_LOCKS.info Number of locks used by $LABEL."
1279 + echo "${NAME}_SOCK.label $LABEL: Sockets"
1280 + echo "${NAME}_SOCK.info Number of sockets used by $LABEL."
1281 + echo "${NAME}_MSGQ.label $LABEL: Message queues"
1282 + echo "${NAME}_MSGQ.info Number of message queues used by $LABEL."
1283 + echo "${NAME}_SHM.label $LABEL: Shared memory"
1284 + echo "${NAME}_SHM.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1285 + echo "${NAME}_SHM.cdef ${NAME}_SHM,$pagesize,*"
1286 + echo "${NAME}_SEMA.label $LABEL: Semaphore arrays"
1287 + echo "${NAME}_SEMA.info Number of semaphore arrays used by $LABEL."
1288 + echo "${NAME}_SEMS.label $LABEL: Semaphores"
1289 + echo "${NAME}_SEMS.info Number of semaphores used by $LABEL."
1290 + echo "${NAME}_DENT.label $LABEL: dentry structs"
1291 + echo "${NAME}_DENT.info Number of dentries used by $LABEL."
1294 echo "$RESOURCE not defined."
1295 @@ -358,7 +443,7 @@ if [ "$1" = "config" ]; then
1296 if [ ! -z "$LIMITS" ] && [ "$LIMITS" = 1 ]; then
1297 LIMIT=$(grep "$RESOURCE" "/proc/virtual/$xid/limit" | cut -f 4)
1298 if [ "${LIMIT:-0}" -gt 0 ]; then
1299 - echo "$NAME.critical $LIMIT"
1300 + echo "${NAME}_${RESOURCE}.critical $LIMIT"
1304 @@ -369,8 +454,18 @@ fi
1305 for xid in $XIDS ; do
1306 LABEL=$(grep "NodeName" "/proc/virtual/$xid/$NAMELOC" | cut -f 2)
1307 NAME=$(echo "$LABEL" | cut -d. -f1 | tr '-' '_')
1308 - awk -v name="${NAME}" -v resource="${RESOURCE}:" \
1309 - '{ if ( $1 == resource ) printf "%s.value %d\n", name, $2 }' \
1310 + if [ $RESOURCE = "ALL" ]; then
1311 + awk -v name="${NAME}" \
1312 + '{ if ( $1 ~ /[A-Z]*:/ ) {
1313 + resource = $1 ; gsub(/:/, "", resource);
1314 + printf "%s_%s.value %d\n", name, resource, $2
1316 + "/proc/virtual/$xid/limit"
1318 + awk -v name="${NAME}" -v resource="${RESOURCE}" \
1319 + '{ if ( $1 ~ resource )
1320 + printf "%s_%s.value %d\n", name, resource, $2 }' \
1321 "/proc/virtual/$xid/limit"