1 diff -urNp munin-2.0.25.orig/dists/tarball/plugins.conf munin-2.0.25/dists/tarball/plugins.conf
2 --- munin-2.0.25.orig/dists/tarball/plugins.conf 2014-11-24 21:46:24.000000000 +0000
3 +++ munin-2.0.25/dists/tarball/plugins.conf 2015-09-08 10:05:48.873593251 +0000
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 -urNp munin-2.0.25.orig/plugins/node.d/amavis.in munin-2.0.25/plugins/node.d/amavis.in
144 --- munin-2.0.25.orig/plugins/node.d/amavis.in 2014-11-24 21:46:24.000000000 +0000
145 +++ munin-2.0.25/plugins/node.d/amavis.in 2015-09-08 10:05:48.874593251 +0000
146 @@ -77,13 +77,12 @@ GPLv2
150 - cmd=`echo $MUNIN_MKTEMP | sed s/\\$1/$1/`
155 AMAVIS_LOG=${amavislog:-/var/log/mail/mail.info}
156 LOGTAIL=${logtail:-logtail}
157 -STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
158 +STATEFILE=@@PLUGSTATE@@/amavis.offset
160 if [ "$1" = "autoconf" ]; then
161 if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
162 @@ -106,7 +105,7 @@ fi
164 if [ "$1" = "config" ]; then
165 echo 'graph_title Amavis filter statistics'
166 - echo 'graph_vlabel \#'
167 + echo 'graph_vlabel mails'
168 echo 'graph_category antivirus'
169 echo 'virus.label virus'
170 echo 'virus.info Number of viruses caught in email'
171 @@ -124,7 +123,7 @@ virus=U
175 -TEMP_FILE=$(mktempfile munin-amavis.XXXXXX)
176 +TEMP_FILE=$(mktempfile munin-amavis.XXXXXXXXXX)
178 if [ -n "$TEMP_FILE" -a -f "$TEMP_FILE" ]
180 diff -urNp munin-2.0.25.orig/plugins/node.d/apache_accesses.in munin-2.0.25/plugins/node.d/apache_accesses.in
181 --- munin-2.0.25.orig/plugins/node.d/apache_accesses.in 2014-11-24 21:46:24.000000000 +0000
182 +++ munin-2.0.25/plugins/node.d/apache_accesses.in 2015-09-08 10:05:48.875593251 +0000
183 @@ -89,6 +89,7 @@ if (! eval "require LWP::UserAgent;")
185 my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
186 my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
187 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
189 if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
191 @@ -129,7 +130,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
193 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
195 - print "graph_title Apache accesses\n";
196 + print "graph_title Apache accesses";
198 + print " for $HOST";
201 print "graph_args --base 1000\n";
202 print "graph_vlabel accesses / \${graph_period}\n";
203 print "graph_category apache\n";
204 diff -urNp munin-2.0.25.orig/plugins/node.d/apache_processes.in munin-2.0.25/plugins/node.d/apache_processes.in
205 --- munin-2.0.25.orig/plugins/node.d/apache_processes.in 2014-11-24 21:46:24.000000000 +0000
206 +++ munin-2.0.25/plugins/node.d/apache_processes.in 2015-09-08 10:05:48.876593251 +0000
207 @@ -96,6 +96,7 @@ if (! eval "require LWP::UserAgent;")
209 my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
210 my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
211 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
212 my $SHOWFREE = !exists $ENV{'showfree'} || $ENV{'showfree'};
214 if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
215 @@ -136,7 +137,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
217 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
219 - print "graph_title Apache processes\n";
220 + print "graph_title Apache processes";
222 + print " for $HOST";
225 print "graph_args --base 1000 -l 0\n";
226 print "graph_category apache\n";
227 print "graph_order ";
228 diff -urNp munin-2.0.25.orig/plugins/node.d/apache_volume.in munin-2.0.25/plugins/node.d/apache_volume.in
229 --- munin-2.0.25.orig/plugins/node.d/apache_volume.in 2014-11-24 21:46:24.000000000 +0000
230 +++ munin-2.0.25/plugins/node.d/apache_volume.in 2015-09-08 10:05:48.876593251 +0000
231 @@ -89,6 +89,7 @@ if (! eval "require LWP::UserAgent;")
233 my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto";
234 my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80);
235 +my $HOST = exists $ENV{'host'} ? $ENV{'host'} : undef;
237 if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
239 @@ -129,7 +130,11 @@ if ( defined $ARGV[0] and $ARGV[0] eq "a
241 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
243 - print "graph_title Apache volume\n";
244 + print "graph_title Apache volume";
246 + print " for $HOST";
249 print "graph_args --base 1000\n";
250 print "graph_vlabel bytes per \${graph_period}\n";
251 print "graph_category apache\n";
252 diff -urNp munin-2.0.25.orig/plugins/node.d/bind9.in munin-2.0.25/plugins/node.d/bind9.in
253 --- munin-2.0.25.orig/plugins/node.d/bind9.in 2014-11-24 21:46:24.000000000 +0000
254 +++ munin-2.0.25/plugins/node.d/bind9.in 2015-09-08 10:05:48.877593251 +0000
255 @@ -53,7 +53,7 @@ GPLv2
258 my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
259 -my $STATEFILE= "$ENV{MUNIN_PLUGSTATE}/bind9.state";
260 +my $STATEFILE= "@@PLUGSTATE@@/bind9.state";
264 @@ -63,7 +63,7 @@ sub get_state {
265 open(Q, ">", $STATEFILE);
268 - open(Q,"< $STATEFILE") or die ("Cannot open state file");
269 + open(Q,"< $STATEFILE") or return ("Cannot open state file");
272 my ($q,$n) = split(/\s+/,$_,2);
273 diff -urNp munin-2.0.25.orig/plugins/node.d/courier_.in munin-2.0.25/plugins/node.d/courier_.in
274 --- munin-2.0.25.orig/plugins/node.d/courier_.in 2014-11-24 21:46:24.000000000 +0000
275 +++ munin-2.0.25/plugins/node.d/courier_.in 2015-09-08 10:05:48.877593251 +0000
276 @@ -55,7 +55,7 @@ Unknown
277 COURIER_LOG=${logfile:-/var/log/mail.log}
278 SERVICE=${service:-`basename $0 | sed 's/^courier_//g'`}
279 OFFSET_FILE=${MUNIN_PLUGSTATE}/courier_${SERVICE}.offset
280 -LOGTAIL=${logtail:-/usr/sbin/logtail}
281 +LOGTAIL=${logtail:-`which logtail`}
285 diff -urNp munin-2.0.25.orig/plugins/node.d/courier_mta_mailstats.in munin-2.0.25/plugins/node.d/courier_mta_mailstats.in
286 --- munin-2.0.25.orig/plugins/node.d/courier_mta_mailstats.in 2014-11-24 21:46:24.000000000 +0000
287 +++ munin-2.0.25/plugins/node.d/courier_mta_mailstats.in 2015-09-08 10:05:48.878593251 +0000
288 @@ -108,7 +108,9 @@ if(!defined $pos) {
290 if($startsize < $pos) {
292 - parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
293 + if (-f $rotlogfile) {
294 + parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
299 diff -urNp munin-2.0.25.orig/plugins/node.d/courier_mta_mailvolume.in munin-2.0.25/plugins/node.d/courier_mta_mailvolume.in
300 --- munin-2.0.25.orig/plugins/node.d/courier_mta_mailvolume.in 2014-11-24 21:46:24.000000000 +0000
301 +++ munin-2.0.25/plugins/node.d/courier_mta_mailvolume.in 2015-09-08 10:05:48.878593251 +0000
302 @@ -98,7 +98,9 @@ if(!defined $pos) {
304 if($startsize < $pos) {
306 - parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
307 + if (-f $rotlogfile) {
308 + parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
313 diff -urNp munin-2.0.25.orig/plugins/node.d/cupsys_pages.in munin-2.0.25/plugins/node.d/cupsys_pages.in
314 --- munin-2.0.25.orig/plugins/node.d/cupsys_pages.in 2014-11-24 21:46:24.000000000 +0000
315 +++ munin-2.0.25/plugins/node.d/cupsys_pages.in 2015-09-08 10:05:48.878593251 +0000
316 @@ -100,7 +100,9 @@ if (!defined $pos) {
318 if ($startsize < $pos) {
320 - parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
321 + if (-f $rotlogfile) {
322 + parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
327 @@ -146,7 +148,7 @@ sub parselogfile {
328 while (tell(LOGFILE) < $stop) {
329 my $line = <LOGFILE>;
331 - if ($line =~ /^(\S+)\s+\S+\s+\d+\s+\[[^\]]+\]\s+(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/) {
332 + if ($line =~ /^(\S+)\s+\S+\s+\S+\s+\[[^\]]+\]\s+(\d+)\s+(\d+)\s+(.+)$/) {
333 if(!defined($printers{$1}) && keys(%printers) < $MAXLABEL) {
334 $printers{$1} += int($2)*int($3);
335 } elsif(defined($printers{$1})) {
336 diff -urNp munin-2.0.25.orig/plugins/node.d/foldingathome_rank.in munin-2.0.25/plugins/node.d/foldingathome_rank.in
337 --- munin-2.0.25.orig/plugins/node.d/foldingathome_rank.in 2014-11-24 21:46:24.000000000 +0000
338 +++ munin-2.0.25/plugins/node.d/foldingathome_rank.in 2015-09-08 10:05:48.879593251 +0000
341 #%# capabilities=autoconf
343 -statefile=$MUNIN_PLUGSTATE/plugin-fah_rank.state
344 +statefile=@@PLUGSTATE@@/plugin-fah_rank.state
346 if [ "$1" = "autoconf" ]; then
347 # No real check of anything
348 diff -urNp munin-2.0.25.orig/plugins/node.d/mailman.in munin-2.0.25/plugins/node.d/mailman.in
349 --- munin-2.0.25.orig/plugins/node.d/mailman.in 2014-11-24 21:46:24.000000000 +0000
350 +++ munin-2.0.25/plugins/node.d/mailman.in 2015-09-08 10:05:48.879593251 +0000
351 @@ -38,7 +38,13 @@ $members = 0;
353 $logfile = $ENV{'logfile'} || "/var/log/mailman/post";
354 $libdir = $ENV{'libdir'} || "/var/lib/mailman";
355 -$lister = $ENV{'lister'} || "/usr/lib/mailman/bin/list_members";
356 +$lister = $ENV{'lister'} || {
357 + if (-f "/usr/lib64/mailman/bin/list_members") {
358 + $lister = "/usr/lib64/mailman/bin/list_members";
360 + $lister = "/usr/lib/mailman/bin/list_members";
366 @@ -94,7 +100,9 @@ if(!defined $pos) {
368 } elsif($startsize < $pos) {
370 - parseMailmanLog($rotlogfile, $pos, (stat $rotlogfile)[7]);
371 + if (-f $rotlogfile) {
372 + parseMailmanLog($rotlogfile, $pos, (stat $rotlogfile)[7]);
377 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_.in munin-2.0.25/plugins/node.d/mysql_.in
378 --- munin-2.0.25.orig/plugins/node.d/mysql_.in 2014-11-24 21:46:24.000000000 +0000
379 +++ munin-2.0.25/plugins/node.d/mysql_.in 2015-09-08 10:05:48.881593251 +0000
380 @@ -39,6 +39,7 @@ Non-default example:
381 env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=3306
383 env.mysqlpassword geheim
384 + env.mysqlnosuperpriv 1
385 env.cachenamespace munin_mysql_pri
387 env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=13306
388 @@ -156,6 +157,7 @@ my %config = (
389 'user' => $ENV{'mysqluser'} || 'root',
390 'password' => $ENV{'mysqlpassword'} || '',
391 'cache_namespace' => $ENV{'cachenamespace'} || 'munin_mysql',
392 + 'nosuper' => $ENV{'mysqlnosuperpriv'} || 0,
396 @@ -927,8 +929,10 @@ sub update_data {
398 update_variables($dbh);
400 - update_master($dbh);
401 - update_slave($dbh);
402 + if (!$config{nosuper}) {
403 + update_master($dbh);
404 + update_slave($dbh);
407 $shared_memory_cache->set('data', $data);
409 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_innodb.in munin-2.0.25/plugins/node.d/mysql_innodb.in
410 --- munin-2.0.25.orig/plugins/node.d/mysql_innodb.in 2014-11-24 21:46:24.000000000 +0000
411 +++ munin-2.0.25/plugins/node.d/mysql_innodb.in 2015-09-08 10:05:48.881593251 +0000
418 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_slowqueries.in munin-2.0.25/plugins/node.d/mysql_slowqueries.in
419 --- munin-2.0.25.orig/plugins/node.d/mysql_slowqueries.in 2014-11-24 21:46:24.000000000 +0000
420 +++ munin-2.0.25/plugins/node.d/mysql_slowqueries.in 2015-09-08 10:05:48.882593251 +0000
421 @@ -64,5 +64,5 @@ if [ "$1" = "config" ]; then
425 -/usr/bin/printf "queries.value "
426 +/bin/printf "queries.value "
427 ($MYSQLADMIN $MYSQLOPTS status 2>/dev/null || echo a a a a a a a a U) | awk '{print $9}'
428 diff -urNp munin-2.0.25.orig/plugins/node.d/mysql_threads.in munin-2.0.25/plugins/node.d/mysql_threads.in
429 --- munin-2.0.25.orig/plugins/node.d/mysql_threads.in 2014-11-24 21:46:24.000000000 +0000
430 +++ munin-2.0.25/plugins/node.d/mysql_threads.in 2015-09-08 10:05:48.882593251 +0000
431 @@ -74,5 +74,5 @@ if [ "$1" = "config" ]; then
435 -/usr/bin/printf "threads.value "
436 +/bin/printf "threads.value "
437 ($MYSQLADMIN $MYSQLOPTS status 2>/dev/null || echo 'a a a U') | awk '{print $4}'
438 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_.in munin-2.0.25/plugins/node.d/ntp_.in
439 --- munin-2.0.25.orig/plugins/node.d/ntp_.in 2014-11-24 21:46:24.000000000 +0000
440 +++ munin-2.0.25/plugins/node.d/ntp_.in 2015-09-08 10:05:48.883593251 +0000
441 @@ -57,26 +57,26 @@ use Net::DNS;
444 if ($ARGV[0] and $ARGV[0] eq "autoconf") {
445 - `ntpq -c help >/dev/null 2>/dev/null`;
446 + `/usr/sbin/ntpq -c help >/dev/null 2>/dev/null`;
447 if ($CHILD_ERROR eq "0") {
448 - if (`ntpq -n -c peers | wc -l` > 0) {
449 + if (`/usr/sbin/ntpq -n -c peers | wc -l` > 0) {
453 - print "no (ntpq -p returned no peers)\n";
454 + print "no (/usr/sbin/ntpq -p returned no peers)\n";
458 - print "no (ntpq not found)\n";
459 + print "no (/usr/sbin/ntpq not found)\n";
464 if ($ARGV[0] and $ARGV[0] eq "suggest") {
465 - foreach my $line (`ntpq -c associations`) {
466 + foreach my $line (`/usr/sbin/ntpq -c associations`) {
467 if ($line =~ m/^\s*\d+/) {
468 my (undef, undef, $assid, undef, undef, undef, undef, undef, undef, undef) = split(/\s+/, $line);
469 - chomp(my $peerinfo = `ntpq -n -c "readvar $assid srcadr"`);
470 + chomp(my $peerinfo = `/usr/sbin/ntpq -n -c "readvar $assid srcadr"`);
471 $peerinfo =~ s/\R/ /g;
472 my ($peer_addr) = ($peerinfo =~ m/srcadr=(.*)/);
473 print $peer_addr, "\n" unless $peer_addr eq "0.0.0.0";
474 @@ -108,7 +108,7 @@ my $srcadr;
478 -my @associations = `ntpq -c associations`;
479 +my @associations = `/usr/sbin/ntpq -c associations`;
481 foreach my $line (@associations) {
482 if ($line =~ m/^\s*\d+/) {
483 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_kernel_err.in munin-2.0.25/plugins/node.d/ntp_kernel_err.in
484 --- munin-2.0.25.orig/plugins/node.d/ntp_kernel_err.in 2014-11-24 21:46:24.000000000 +0000
485 +++ munin-2.0.25/plugins/node.d/ntp_kernel_err.in 2015-09-08 10:05:48.884593251 +0000
486 @@ -32,7 +32,7 @@ EOF
487 export PATH=/usr/local/sbin:$PATH
489 if [ "$1" = "autoconf" ]; then
490 - { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
491 + { /usr/sbin/ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
493 /^estimated error:/ { ev=0; }
494 END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
495 @@ -51,11 +51,11 @@ fi
497 printf 'ntp_err.value '
499 -if [ $(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
500 +if [ $(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
506 + cmd=/usr/sbin/ntpdc
509 $cmd -c kerninfo | awk '/^estimated error:/ { print $3 }'
510 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_freq.in munin-2.0.25/plugins/node.d/ntp_kernel_pll_freq.in
511 --- munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_freq.in 2014-11-24 21:46:24.000000000 +0000
512 +++ munin-2.0.25/plugins/node.d/ntp_kernel_pll_freq.in 2015-09-08 10:05:48.884593251 +0000
513 @@ -39,7 +39,7 @@ EOF
514 export PATH=/usr/local/sbin:$PATH
516 if [ "$1" = "autoconf" ]; then
517 - { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
518 + { /usr/sbin/ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
520 /^pll frequency:/ { ev=0; }
521 END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
522 @@ -65,11 +65,11 @@ fi
524 printf 'ntp_pll_freq.value '
526 -if [ $(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
527 +if [ $(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
533 + cmd=/usr/sbin/ntpdc
536 $cmd -c kerninfo | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'
537 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_off.in munin-2.0.25/plugins/node.d/ntp_kernel_pll_off.in
538 --- munin-2.0.25.orig/plugins/node.d/ntp_kernel_pll_off.in 2014-11-24 21:46:24.000000000 +0000
539 +++ munin-2.0.25/plugins/node.d/ntp_kernel_pll_off.in 2015-09-08 10:05:48.885593251 +0000
540 @@ -32,7 +32,7 @@ EOF
541 export PATH=/usr/local/sbin:$PATH
543 if [ "$1" = "autoconf" ]; then
544 - { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
545 + { /usr/sbin/ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
547 /^pll offset:/ { ev=0; }
548 END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
549 @@ -51,11 +51,11 @@ fi
551 printf 'ntp_pll_off.value '
553 -if [ $(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
554 +if [ $(/usr/sbin/ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | tr -d '.') -ge 427 ]
560 + cmd=/usr/sbin/ntpdc
563 $cmd -c kerninfo | awk '/^pll offset:/ { print $3 }'
564 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_offset.in munin-2.0.25/plugins/node.d/ntp_offset.in
565 --- munin-2.0.25.orig/plugins/node.d/ntp_offset.in 2014-11-24 21:46:24.000000000 +0000
566 +++ munin-2.0.25/plugins/node.d/ntp_offset.in 2015-09-08 10:05:48.885593251 +0000
567 @@ -38,9 +38,9 @@ Loosely based on ntp_ plugin, but rework
571 - ntpq -c help >/dev/null 2>&1 || { echo 'no (no ntpq program)'; exit 0; }
572 + /usr/sbin/ntpq -c help >/dev/null 2>&1 || { echo 'no (no ntpq program)'; exit 0; }
574 - case "$(ntpq -n -p 2>/dev/null | wc -l)" in
575 + case "$(/usr/sbin/ntpq -n -p 2>/dev/null | wc -l)" in
577 echo 'no (unable to list peers)'
579 @@ -57,7 +57,7 @@ do_autoconf () {
583 - syspeer="$(ntpq -n -p | grep '^[*o]')"
584 + syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
588 @@ -86,7 +86,7 @@ EOF
592 - syspeer="$(ntpq -n -p | grep '^[*o]')"
593 + syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
597 diff -urNp munin-2.0.25.orig/plugins/node.d/ntp_states.in munin-2.0.25/plugins/node.d/ntp_states.in
598 --- munin-2.0.25.orig/plugins/node.d/ntp_states.in 2014-11-24 21:46:24.000000000 +0000
599 +++ munin-2.0.25/plugins/node.d/ntp_states.in 2015-09-08 10:05:48.886593251 +0000
600 @@ -72,10 +72,10 @@ sub make_hash {
601 # 1 63933 931a yes yes none outlyer sys_peer 1
602 # 2 63934 943a yes yes none candidate sys_peer 3
604 - foreach my $line (`ntpq -c associations`) {
605 + foreach my $line (`/usr/sbin/ntpq -c associations`) {
606 if ($line =~ m/^\s*\d+/) {
607 my (undef, undef, $assid, undef, undef, undef, undef, $condition_str, undef, undef) = split(/\s+/, $line);
608 - chomp(my $peerinfo = `ntpq -n -c "readvar $assid srcadr"`);
609 + chomp(my $peerinfo = `/usr/sbin/ntpq -n -c "readvar $assid srcadr"`);
610 $peerinfo =~ s/\s//g;
611 my ($peer_addr) = ($peerinfo =~ m/srcadr=(.*)/);
613 @@ -125,17 +125,17 @@ sub make_names {
616 if ($ARGV[0] and $ARGV[0] eq "autoconf") {
617 - `ntpq -c help >/dev/null 2>/dev/null`;
618 + `/usr/sbin/ntpq -c help >/dev/null 2>/dev/null`;
619 if ($CHILD_ERROR eq "0") {
620 - if (`ntpq -n -c peers | wc -l` > 0) {
621 + if (`/usr/sbin/ntpq -n -c peers | wc -l` > 0) {
625 - print "no (ntpq -p returned no peers)\n";
626 + print "no (/usr/sbin/ntpq -p returned no peers)\n";
630 - print "no (ntpq not found)\n";
631 + print "no (/usr/sbin/ntpq not found)\n";
635 diff -urNp munin-2.0.25.orig/plugins/node.d/nut_misc.in munin-2.0.25/plugins/node.d/nut_misc.in
636 --- munin-2.0.25.orig/plugins/node.d/nut_misc.in 2014-11-24 21:46:24.000000000 +0000
637 +++ munin-2.0.25/plugins/node.d/nut_misc.in 2015-09-08 10:05:48.886593251 +0000
638 @@ -38,7 +38,8 @@ use strict;
642 - upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha@127.0.0.1',
643 + upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha',
644 + upshost => $ENV{"upshost"} ? $ENV{"upshost"} : '127.0.0.1',
645 upsc => $ENV{"upsc"} ? $ENV{"upsc"} : 'upsc'
648 @@ -48,11 +49,6 @@ my %graph = (
652 - 'battery_voltage' => {
653 - label => 'batt voltage - V',
657 'battery_runtime' => {
658 label => 'runtime - min',
660 @@ -76,7 +72,12 @@ my %graph = (
663 if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
664 - print "graph_title UPS Misc - $config{upsname}\n";
665 + my $s = $config{upsname};
667 + if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
668 + $s .= " at $config{upshost}";
670 + print "graph_title UPS Misc - $s\n";
671 #print "graph_args -l 110\n";
672 #print "graph_vlabel Misc\n";
673 foreach my $key (keys %graph) {
674 @@ -89,7 +90,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq 'c
678 - my $data = `$config{upsc} $config{upsname}`;
679 + my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
680 while ($data =~ /([a-z.]+): (.+)\b/g) {
683 diff -urNp munin-2.0.25.orig/plugins/node.d/nut_volts.in munin-2.0.25/plugins/node.d/nut_volts.in
684 --- munin-2.0.25.orig/plugins/node.d/nut_volts.in 2014-11-24 21:46:24.000000000 +0000
685 +++ munin-2.0.25/plugins/node.d/nut_volts.in 2015-09-08 10:05:48.887593251 +0000
686 @@ -14,7 +14,8 @@ use strict;
690 - upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha@127.0.0.1',
691 + upsname => $ENV{"upsname"} ? $ENV{"upsname"} : 'bertha',
692 + upshost => $ENV{"upshost"} ? $ENV{"upshost"} : '127.0.0.1',
693 upsc => $ENV{"upsc"} ? $ENV{"upsc"} : 'upsc'
696 @@ -24,16 +25,6 @@ my %graph = (
700 - 'input_voltage_maximum' => {
701 - label => 'max input seen',
705 - 'input_voltage_minimum' => {
706 - label => 'min input seen',
710 'output_voltage' => {
713 @@ -42,7 +33,12 @@ my %graph = (
716 if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
717 - print "graph_title UPS Voltages - $config{upsname}\n";
718 + my $s = $config{upsname};
720 + if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
721 + $s .= " at $config{upshost}";
723 + print "graph_title UPS Voltages - $s\n";
724 print "graph_args -l 115\n";
725 print "graph_vlabel Volts\n";
726 foreach my $key (keys %graph) {
727 @@ -55,7 +51,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq 'c
731 - my $data = `$config{upsc} $config{upsname}`;
732 + my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
733 while ($data =~ /([a-z.]+): (.+)\b/g) {
736 diff -urNp munin-2.0.25.orig/plugins/node.d/perdition.in munin-2.0.25/plugins/node.d/perdition.in
737 --- munin-2.0.25.orig/plugins/node.d/perdition.in 2014-11-24 21:46:24.000000000 +0000
738 +++ munin-2.0.25/plugins/node.d/perdition.in 2015-09-08 10:05:48.887593251 +0000
739 @@ -56,7 +56,7 @@ mktempfile () {
740 # Set the location of the perdition logs
741 PERDITION_LOG=${logfile:-/var/log/perdition.log}
742 OFFSET_FILE=${MUNIN_PLUGSTATE}/perdition.offset
743 -LOGTAIL=${logtail:-/usr/sbin/logtail}
744 +LOGTAIL=${logtail:-`which logtail`}
748 diff -urNp munin-2.0.25.orig/plugins/node.d/pop_stats.in munin-2.0.25/plugins/node.d/pop_stats.in
749 --- munin-2.0.25.orig/plugins/node.d/pop_stats.in 2014-11-24 21:46:24.000000000 +0000
750 +++ munin-2.0.25/plugins/node.d/pop_stats.in 2015-09-08 10:05:48.888593251 +0000
751 @@ -68,7 +68,9 @@ if (!defined $pos)
752 if ($startsize < $pos)
755 - parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
756 + if (-f $pop{'rotlogfile'}) {
757 + parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
762 diff -urNp munin-2.0.25.orig/plugins/node.d/postgres_scans_.in munin-2.0.25/plugins/node.d/postgres_scans_.in
763 --- munin-2.0.25.orig/plugins/node.d/postgres_scans_.in 2014-11-24 21:46:24.000000000 +0000
764 +++ munin-2.0.25/plugins/node.d/postgres_scans_.in 2015-09-08 10:05:48.888593251 +0000
765 @@ -65,7 +65,6 @@ my $pg = Munin::Plugin::Pgsql->new(
766 vlabel => 'Scans / sec',
768 "SELECT COALESCE(sum(seq_scan),0) AS sequential, COALESCE(sum(idx_scan),0) AS index FROM pg_stat_user_tables",
769 - paramdatabase => 1,
772 "VALUES ('sequential','Sequential scans'), ('index','Index scans')",
773 diff -urNp munin-2.0.25.orig/plugins/node.d/postgres_tuples_.in munin-2.0.25/plugins/node.d/postgres_tuples_.in
774 --- munin-2.0.25.orig/plugins/node.d/postgres_tuples_.in 2014-11-24 21:46:24.000000000 +0000
775 +++ munin-2.0.25/plugins/node.d/postgres_tuples_.in 2015-09-08 10:05:48.889593251 +0000
776 @@ -74,7 +74,6 @@ my $pg = Munin::Plugin::Pgsql->new(
777 . " COALESCE(sum(n_tup_del),0) AS deleted FROM pg_stat_user_tables",
780 - paramdatabase => 1,
783 "VALUES ('seqread','Tuples sequentally read'), ('idxfetch','Tuples index fetched'), ('inserted','Tuples inserted'),"
784 diff -urNp munin-2.0.25.orig/plugins/node.d/slapd_.in munin-2.0.25/plugins/node.d/slapd_.in
785 --- munin-2.0.25.orig/plugins/node.d/slapd_.in 2014-11-24 21:46:24.000000000 +0000
786 +++ munin-2.0.25/plugins/node.d/slapd_.in 2015-09-08 10:05:48.890593251 +0000
787 @@ -37,7 +37,7 @@ use vars qw ( $config $param $act $scope
789 # Change these to reflect your LDAP ACL. The given DN must have
790 # read access to the Monitor branch.
791 -my $basedn = "cn=Monitor";
792 +my $basedn = ($ENV{'basedn'} || "cn=Monitor");
793 my $server = ($ENV{'server'} || 'localhost');
794 my $userdn = ($ENV{'binddn'} || '');
795 my $userpw = ($ENV{'bindpw'} || '');
796 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/iostat.in munin-2.0.25/plugins/node.d.linux/iostat.in
797 --- munin-2.0.25.orig/plugins/node.d.linux/iostat.in 2014-11-24 21:46:24.000000000 +0000
798 +++ munin-2.0.25/plugins/node.d.linux/iostat.in 2015-09-08 10:05:55.475593251 +0000
799 @@ -173,7 +173,7 @@ sub fetch_detailed() {
800 if ($tmpnam =~ /\d+$/ and !$include_numbered) {
801 # Special case for devices like cXdXpX,
802 # like the cciss driver
803 - next unless $tmpnam =~ /\/c\d+d\d+$/
804 + next unless $tmpnam =~ /\/.*d\d+$/
806 next unless grep { $_ } @fields;
808 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/ip_.in munin-2.0.25/plugins/node.d.linux/ip_.in
809 --- munin-2.0.25.orig/plugins/node.d.linux/ip_.in 2014-11-24 21:46:24.000000000 +0000
810 +++ munin-2.0.25/plugins/node.d.linux/ip_.in 2015-09-08 10:05:55.476593251 +0000
811 @@ -127,14 +127,18 @@ case $IP in
812 # This is a fun hack to make the plugin ip6 compatible.
813 # Suggested in ticket #439 by "jodal".
816 + /usr/sbin/ip6tables "$@"
819 + *) eval 'iptables() {
820 + /usr/sbin/iptables "$@"
825 if [[ "$1" == "autoconf" ]]; then
826 if [[ -r /proc/net/dev ]]; then
827 - if ! iptables -L ${INPUT} -v -n -x >/dev/null 2>/dev/null; then
828 + if ! /usr/sbin/iptables -L ${INPUT} -v -n -x >/dev/null 2>/dev/null; then
829 echo "no (could not run iptables as user $(whoami))"
832 @@ -147,10 +151,10 @@ if [[ "$1" == "autoconf" ]]; then
836 -if [[ "$1" == "suggest" ]]; then
837 - iptables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$8 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
838 - if [[ -x /sbin/ip6tables ]]; then
839 - ip6tables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
840 +if [ "$1" = "suggest" ]; then
841 + /usr/sbin/iptables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$8 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
842 + if [[ -x /usr/sbin/ip6tables ]]; then
843 + /usr/sbin/ip6tables -L ${INPUT} -v -n -x 2>/dev/null | awk --posix '$7 ~ /\/128$/ { if (done[$7]!=1) {a=$7;gsub(/\/128$/, "", a); print a; done[$7]=1;}}'
847 @@ -183,5 +187,5 @@ fi;
849 # Escape .'s so they don't match _everything_?
850 IP=$(echo $IP | sed 's~\.~\\.~g')
851 -iptables -L ${INPUT} -v -n -x | awk "/$IP"'[ /]/ { print "in.value " $2; exit 0; }'
852 -iptables -L ${OUTPUT} -v -n -x | awk "/$IP"'[ /]/ { print "out.value " $2; exit 0; }'
853 +/usr/sbin/iptables -L ${INPUT} -v -n -x | awk "/$IP"'[ \/]/ { print "in.value " $2; exit 0; }'
854 +/usr/sbin/iptables -L ${OUTPUT} -v -n -x | awk "/$IP"'[ \/]/ { print "out.value " $2; exit 0; }'
855 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/load.in munin-2.0.25/plugins/node.d.linux/load.in
856 --- munin-2.0.25.orig/plugins/node.d.linux/load.in 2014-11-24 21:46:24.000000000 +0000
857 +++ munin-2.0.25/plugins/node.d.linux/load.in 2015-09-08 10:05:55.476593251 +0000
858 @@ -59,20 +59,20 @@ if [ "$1" = "config" ]; then
859 # one machine answer for several)
861 # The title of the graph
862 - echo 'graph_title Load average'
863 + echo "graph_title Load average"
864 # Arguments to "rrdtool graph". In this case, tell it that the
865 # lower limit of the graph is '0', and that 1k=1000 (not 1024)
866 - echo 'graph_args --base 1000 -l 0'
867 + echo "graph_args --base 1000 -l 0"
869 - echo 'graph_vlabel load'
870 + echo "graph_vlabel load"
871 # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
873 - echo 'graph_scale no'
874 + echo "graph_scale no"
875 # Graph category. Defaults to 'other'
876 - echo 'graph_category system'
877 + echo "graph_category system"
878 # The fields. "label" is used in the legend. "label" is the only
880 - echo 'load.label load'
881 + echo "load.label load"
882 # These two read the environment for warning values for the field
883 # "load". If "load_warning" or "warning" aren't set in the
884 # environment, no warning levels are set. Likewise for "load_critical"
885 @@ -82,8 +82,8 @@ if [ "$1" = "config" ]; then
886 # This one is purely to add an explanation to the web page. The first
887 # one is for the graph itself, while the second one is for the field
889 - echo 'graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run "immediately").'
890 - echo 'load.info 5 minute load average'
891 + echo "graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run \"immediately\")."
892 + echo "load.info 5 minute load average"
894 # Last, if run with the "config"-parameter, quit here (don't
896 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/nfs_client.in munin-2.0.25/plugins/node.d.linux/nfs_client.in
897 --- munin-2.0.25.orig/plugins/node.d.linux/nfs_client.in 2014-11-24 21:46:24.000000000 +0000
898 +++ munin-2.0.25/plugins/node.d.linux/nfs_client.in 2015-09-08 10:05:55.477593251 +0000
899 @@ -31,7 +31,7 @@ NFS=/proc/net/rpc/nfs
900 proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
902 if [ "$1" = "autoconf" ]; then
903 - if [ -f "$NFS" ]; then
904 + if [ -r "$NFS" ]; then
908 @@ -51,11 +51,66 @@ if [ "$1" = "config" ]; then
913 - split("'"$proc"'", names)
916 - printf("%s.value %d\n", names[++i], values[i+3]);
952 + nfs_readdirplus+=$20
959 + print "getattr.value " nfs_getattr
960 + print "setattr.value " nfs_setattr
961 + print "lookup.value " nfs_lookup
962 + print "access.value " nfs_access
963 + print "readlink.value " nfs_readlink
964 + print "read.value " nfs_read
965 + print "write.value " nfs_write
966 + print "create.value " nfs_create
967 + print "mkdir.value " nfs_mkdir
968 + print "symlink.value " nfs_symlink
969 + print "mknod.value " nfs_mknod
970 + print "remove.value " nfs_remove
971 + print "rmdir.value " nfs_rmdir
972 + print "rename.value " nfs_rename
973 + print "link.value " nfs_link
974 + print "readdir.value " nfs_readdir
975 + print "readdirplus.value " nfs_readdirplus
976 + print "fsstat.value " nfs_fsstat
977 + print "fsinfo.value " nfs_fsinfo
978 + print "pathconf.value " nfs_pathconf
979 + print "commit.value " nfs_commit
982 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/nfsd.in munin-2.0.25/plugins/node.d.linux/nfsd.in
983 --- munin-2.0.25.orig/plugins/node.d.linux/nfsd.in 2014-11-24 21:46:24.000000000 +0000
984 +++ munin-2.0.25/plugins/node.d.linux/nfsd.in 2015-09-08 10:05:55.477593251 +0000
985 @@ -31,7 +31,7 @@ NFSD=/proc/net/rpc/nfsd
986 proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
988 if [ "$1" = "autoconf" ]; then
989 - if [ -f "$NFSD" ]; then
990 + if [ -r "$NFSD" ]; then
994 @@ -51,9 +51,66 @@ if [ "$1" = "config" ]; then
999 - split("'"$proc"'", names)
1002 - printf("%s.value %d\n", names[++i], values[i+3]);
1038 + nfs_readdirplus+=$20
1045 + print "getattr.value " nfs_getattr
1046 + print "setattr.value " nfs_setattr
1047 + print "lookup.value " nfs_lookup
1048 + print "access.value " nfs_access
1049 + print "readlink.value " nfs_readlink
1050 + print "read.value " nfs_read
1051 + print "write.value " nfs_write
1052 + print "create.value " nfs_create
1053 + print "mkdir.value " nfs_mkdir
1054 + print "symlink.value " nfs_symlink
1055 + print "mknod.value " nfs_mknod
1056 + print "remove.value " nfs_remove
1057 + print "rmdir.value " nfs_rmdir
1058 + print "rename.value " nfs_rename
1059 + print "link.value " nfs_link
1060 + print "readdir.value " nfs_readdir
1061 + print "readdirplus.value " nfs_readdirplus
1062 + print "fsstat.value " nfs_fsstat
1063 + print "fsinfo.value " nfs_fsinfo
1064 + print "pathconf.value " nfs_pathconf
1065 + print "commit.value " nfs_commit
1067 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/vlan_inetuse_.in munin-2.0.25/plugins/node.d.linux/vlan_inetuse_.in
1068 --- munin-2.0.25.orig/plugins/node.d.linux/vlan_inetuse_.in 2014-11-24 21:46:24.000000000 +0000
1069 +++ munin-2.0.25/plugins/node.d.linux/vlan_inetuse_.in 2015-09-08 10:05:55.477593251 +0000
1070 @@ -37,8 +37,8 @@ my %contraries = ("dpt" => "spt", "spt"
1072 my %out_octets = ();
1074 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-in |") or
1075 - die "Could not run iptables: $!\n";
1076 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-in |") or
1077 + die "Could not run /usr/sbin/iptables: $!\n";
1080 if (/^\s*\d+\s+(\d+) +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1081 @@ -49,10 +49,10 @@ while (<IN>)
1085 -die "Error running iptables. Dying\n" if $?;
1086 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1088 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-out |") or
1089 - die "Could not run iptables: $!\n";
1090 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-out |") or
1091 + die "Could not run /usr/sbin/iptables: $!\n";
1094 if (/^\s*\d+\s+(\d+) +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1095 @@ -67,7 +67,7 @@ while (<IN>)
1099 -die "Error running iptables. Dying\n" if $?;
1100 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1102 if ($ARGV[0] and $ARGV[0] eq "config")
1104 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/vlan_linkuse_.in munin-2.0.25/plugins/node.d.linux/vlan_linkuse_.in
1105 --- munin-2.0.25.orig/plugins/node.d.linux/vlan_linkuse_.in 2014-11-24 21:46:24.000000000 +0000
1106 +++ munin-2.0.25/plugins/node.d.linux/vlan_linkuse_.in 2015-09-08 10:05:55.477593251 +0000
1107 @@ -29,8 +29,8 @@ my %contraries = ("dpt" => "spt", "spt"
1109 my %out_octets = ();
1111 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-in |") or
1112 - die "Could not run iptables: $!\n";
1113 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-in |") or
1114 + die "Could not run /usr/sbin/iptables: $!\n";
1117 if (/^\s*\d+\s+(\d+) +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1118 @@ -58,10 +58,10 @@ while (<IN>)
1122 -die "Error running iptables. Dying\n" if $?;
1123 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1125 -open (IN, "/sbin/iptables -v -x -L $INTERFACE-out |") or
1126 - die "Could not run iptables: $!\n";
1127 +open (IN, "/usr/sbin/iptables -v -x -L $INTERFACE-out |") or
1128 + die "Could not run /usr/sbin/iptables: $!\n";
1131 if (/^\s*\d+\s+(\d+) +([a-z]+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+(?:\s+|)(.+|)$/)
1132 @@ -84,5 +84,5 @@ while (<IN>)
1136 -die "Error running iptables. Dying\n" if $?;
1137 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
1139 diff -urNp munin-2.0.25.orig/plugins/node.d.linux/vserver_resources.in munin-2.0.25/plugins/node.d.linux/vserver_resources.in
1140 --- munin-2.0.25.orig/plugins/node.d.linux/vserver_resources.in 2014-11-24 21:46:24.000000000 +0000
1141 +++ munin-2.0.25/plugins/node.d.linux/vserver_resources.in 2015-09-08 10:05:55.478593251 +0000
1142 @@ -245,6 +245,12 @@ if [ "$1" = "config" ]; then
1143 echo 'graph_vlabel ANON pages'
1144 echo 'graph_info Shows anonymous memory (human readable) used by each vserver.'
1147 + echo 'graph_title Mapped memory used by vserver'
1148 + echo 'graph_args --base 1024k -l 0'
1149 + echo 'graph_vlabel RMAP pages'
1150 + echo 'graph_info Shows mapped memory (human readable) used by each vserver.'
1153 echo 'graph_title Files used by vserver'
1154 echo 'graph_args --base 1024k -l 0'
1155 @@ -281,6 +287,30 @@ if [ "$1" = "config" ]; then
1156 echo 'graph_vlabel SHM pages'
1157 echo 'graph_info Shows shared memory (human readable) used by each vserver.'
1160 + echo 'graph_title Semaphore arrays used by vserver'
1161 + echo 'graph_args --base 1024k -l 0'
1162 + echo 'graph_vlabel Semaphore arrays'
1163 + echo 'graph_info Shows semaphore arrays used by each vserver.'
1166 + echo 'graph_title Semaphores used by vserver'
1167 + echo 'graph_args --base 1024k -l 0'
1168 + echo 'graph_vlabel Semaphores'
1169 + echo 'graph_info Shows semaphores used by each vserver.'
1172 + echo 'graph_title dentry structs used by vserver'
1173 + echo 'graph_args --base 1024k -l 0'
1174 + echo 'graph_vlabel dentry structs'
1175 + echo 'graph_info Shows dentry structs used by each vserver.'
1178 + echo 'graph_title Resources used by vserver'
1179 + echo 'graph_args --base 1024k -l 0'
1180 + echo 'graph_vlabel Resources'
1181 + echo 'graph_info Shows rsources used by each vserver.'
1184 echo "$RESOURCE not defined."
1186 @@ -299,53 +329,108 @@ if [ "$1" = "config" ]; then
1190 - echo "$NAME.label $LABEL: processes"
1191 - echo "$NAME.info Number of processes used by $LABEL."
1192 + echo "${NAME}_PROC.label $LABEL: processes"
1193 + echo "${NAME}_PROC.info Number of processes used by $LABEL."
1196 - echo "$NAME.label $LABEL: Virtual memory"
1197 - echo "$NAME.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1198 - echo "$NAME.cdef $NAME,$pagesize,*"
1199 + echo "${NAME}_VM.label $LABEL: Virtual memory"
1200 + echo "${NAME}_VM.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1201 + echo "${NAME}_VM.cdef ${NAME}_VM,$pagesize,*"
1204 - echo "$NAME.label $LABEL: Locked memory"
1205 - echo "$NAME.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1206 - echo "$NAME.cdef $NAME,$pagesize,*"
1207 + echo "${NAME}_VML.label $LABEL: Locked memory"
1208 + echo "${NAME}_VML.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1209 + echo "${NAME}_VML.cdef ${NAME}_VML,$pagesize,*"
1212 - echo "$NAME.label $LABEL: Resident set size"
1213 - echo "$NAME.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1214 - echo "$NAME.cdef $NAME,$pagesize,*"
1215 + echo "${NAME}_RSS.label $LABEL: Resident set size"
1216 + echo "${NAME}_RSS.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1217 + echo "${NAME}_RSS.cdef ${NAME}_RSS,$pagesize,*"
1220 - echo "$NAME.label $LABEL: Anonymous memory"
1221 - echo "$NAME.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1222 - echo "$NAME.cdef $NAME,$pagesize,*"
1223 + echo "${NAME}_ANON.label $LABEL: Anonymous memory"
1224 + echo "${NAME}_ANON.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1225 + echo "${NAME}_ANON.cdef ${NAME}_ANON,$pagesize,*"
1228 + echo "${NAME}_RMAP.label $LABEL: Mapped memory"
1229 + echo "${NAME}_RMAP.info Size of mapped memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1230 + echo "${NAME}_RMAP.cdef ${NAME}_RMAP,$pagesize,*"
1233 - echo "$NAME.label $LABEL: Files"
1234 - echo "$NAME.info Number of files used by $LABEL."
1235 + echo "${NAME}_FILES.label $LABEL: Files"
1236 + echo "${NAME}_FILES.info Number of files used by $LABEL."
1239 - echo "$NAME.label $LABEL: Open filedescriptors"
1240 - echo "$NAME.info Number of open filedescriptors used by $LABEL."
1241 + echo "${NAME}_OFD.label $LABEL: Open filedescriptors"
1242 + echo "${NAME}_OFD.info Number of open filedescriptors used by $LABEL."
1245 - echo "$NAME.label $LABEL: Locks"
1246 - echo "$NAME.info Number of locks used by $LABEL."
1247 + echo "${NAME}_LOCKS.label $LABEL: Locks"
1248 + echo "${NAME}_LOCKS.info Number of locks used by $LABEL."
1251 - echo "$NAME.label $LABEL: Sockets"
1252 - echo "$NAME.info Number of sockets used by $LABEL."
1253 + echo "${NAME}_SOCK.label $LABEL: Sockets"
1254 + echo "${NAME}_SOCK.info Number of sockets used by $LABEL."
1257 - echo "$NAME.label $LABEL: Message queues"
1258 - echo "$NAME.info Number of message queues used by $LABEL."
1259 + echo "${NAME}_MSGQ.label $LABEL: Message queues"
1260 + echo "${NAME}_MSGQ.info Number of message queues used by $LABEL."
1263 - echo "$NAME.label $LABEL: Shared memory"
1264 - echo "$NAME.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1265 - echo "$NAME.cdef $1,$pagesize,*"
1266 + echo "${NAME}_SHM.label $LABEL: Shared memory"
1267 + echo "${NAME}_SHM.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1268 + echo "${NAME}_SHM.cdef ${NAME}_SHM,$pagesize,*"
1271 + echo "${NAME}_SEMA.label $LABEL: Semaphore arrays"
1272 + echo "${NAME}_SEMA.info Number of semaphore arrays used by $LABEL."
1275 + echo "${NAME}_SEMS.label $LABEL: Semaphores"
1276 + echo "${NAME}_SEMS.info Number of semaphores used by $LABEL."
1279 + echo "${NAME}_DENT.label $LABEL: dentry structs"
1280 + echo "${NAME}_DENT.info Number of dentries used by $LABEL."
1283 + echo "${NAME}_PROC.label $LABEL: processes"
1284 + echo "${NAME}_PROC.info Number of processes used by $LABEL."
1285 + echo "${NAME}_VM.label $LABEL: Virtual memory"
1286 + echo "${NAME}_VM.info Size of virtual memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1287 + echo "${NAME}_VM.cdef ${NAME}_VM,$pagesize,*"
1288 + echo "${NAME}_VML.label $LABEL: Locked memory"
1289 + echo "${NAME}_VML.info Size of locked memory used by $LABEL. (Number multipled by $pagesize to make it human readable)"
1290 + echo "${NAME}_VML.cdef ${NAME}_VML,$pagesize,*"
1291 + echo "${NAME}_RSS.label $LABEL: Resident set size"
1292 + echo "${NAME}_RSS.info Size of resident set size used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1293 + echo "${NAME}_RSS.cdef ${NAME}_RSS,$pagesize,*"
1294 + echo "${NAME}_ANON.label $LABEL: Anonymous memory"
1295 + echo "${NAME}_ANON.info Size of anonymous memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1296 + echo "${NAME}_ANON.cdef ${NAME}_ANON,$pagesize,*"
1297 + echo "${NAME}_RMAP.label $LABEL: Mapped memory"
1298 + echo "${NAME}_RMAP.info Size of mapped memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1299 + echo "${NAME}_RMAP.cdef ${NAME}_RMAP,$pagesize,*"
1300 + echo "${NAME}_FILES.label $LABEL: Files"
1301 + echo "${NAME}_FILES.info Number of files used by $LABEL."
1302 + echo "${NAME}_OFD.label $LABEL: Open filedescriptors"
1303 + echo "${NAME}_OFD.info Number of open filedescriptors used by $LABEL."
1304 + echo "${NAME}_LOCKS.label $LABEL: Locks"
1305 + echo "${NAME}_LOCKS.info Number of locks used by $LABEL."
1306 + echo "${NAME}_SOCK.label $LABEL: Sockets"
1307 + echo "${NAME}_SOCK.info Number of sockets used by $LABEL."
1308 + echo "${NAME}_MSGQ.label $LABEL: Message queues"
1309 + echo "${NAME}_MSGQ.info Number of message queues used by $LABEL."
1310 + echo "${NAME}_SHM.label $LABEL: Shared memory"
1311 + echo "${NAME}_SHM.info Size of shared memory used by $LABEL. (Number multiplied by $pagesize to make it human readable)"
1312 + echo "${NAME}_SHM.cdef ${NAME}_SHM,$pagesize,*"
1313 + echo "${NAME}_SEMA.label $LABEL: Semaphore arrays"
1314 + echo "${NAME}_SEMA.info Number of semaphore arrays used by $LABEL."
1315 + echo "${NAME}_SEMS.label $LABEL: Semaphores"
1316 + echo "${NAME}_SEMS.info Number of semaphores used by $LABEL."
1317 + echo "${NAME}_DENT.label $LABEL: dentry structs"
1318 + echo "${NAME}_DENT.info Number of dentries used by $LABEL."
1321 echo "$RESOURCE not defined."
1322 @@ -356,7 +441,7 @@ if [ "$1" = "config" ]; then
1323 if [ ! -z "$LIMITS" -a "$LIMITS" = 1 ]; then
1324 LIMIT=`cat /proc/virtual/$xid/limit | grep $RESOURCE | cut -f4`
1325 if [ ${LIMIT:-0} -gt 0 ]; then
1326 - echo "$NAME.critical $LIMIT"
1327 + echo "${NAME}_${RESOURCE}.critical $LIMIT"
1331 @@ -367,8 +452,15 @@ fi
1332 for xid in $XIDS ; do
1333 LABEL=`cat /proc/virtual/$xid/$NAMELOC |grep NodeName |cut -f2`
1334 NAME=`echo $LABEL | cut -d. -f1 | tr '-' '_'`
1335 - cat /proc/virtual/$xid/limit | awk -v name="${NAME}" -v resource="${RESOURCE}:" \
1336 - '{ if ( $1 == resource )
1337 - printf "%s.value %d\n", name, $2 }'
1338 + if [ $RESOURCE = "ALL" ]; then
1339 + cat /proc/virtual/$xid/limit | awk -v name="${NAME}" \
1340 + '{ if ( $1 ~ /[A-Z]*:/ ) {
1341 + resource = $1 ; gsub(/:/, "", resource);
1342 + printf "%s_%s.value %d\n", name, resource, $2
1345 + cat /proc/virtual/$xid/limit | awk -v name="${NAME}" -v resource="${RESOURCE}" \
1346 + '{ if ( $1 ~ resource )
1347 + printf "%s_%s.value %d\n", name, resource, $2 }'