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
7 AMAVIS_LOG=${amavislog:-/var/log/mail/mail.info}
8 LOGTAIL=${logtail:-logtail}
9 -STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
10 +STATEFILE=@@PLUGSTATE@@/amavis.offset
12 if [ "$1" = "autoconf" ]; then
13 if [ -f "${AMAVIS_LOG}" ] && [ -n "${LOGTAIL}" ] && [ -x "${LOGTAIL}" ] ; then
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'
27 -TEMP_FILE=$(@@MKTEMP@@ munin-amavis.XXXXXX)
28 +TEMP_FILE=$(@@MKTEMP@@ munin-amavis.XXXXXXXXXX)
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
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;
42 # Convert an URL with the %d placeholder into a string. Allow URL without placeholder.
45 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
47 - print "graph_title Apache accesses\n";
48 + print "graph_title Apache accesses";
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
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'};
69 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
71 - print "graph_title Apache processes\n";
72 + print "graph_title Apache processes";
77 print "graph_args --base 1000 -l 0\n";
78 print "graph_category apache\n";
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
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;
90 # Convert an URL with the %d placeholder into a string. Allow URL without placeholder.
93 if ( defined $ARGV[0] and $ARGV[0] eq "config" )
95 - print "graph_title Apache volume\n";
96 + print "graph_title Apache volume";
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
110 my $QUERYLOG = $ENV{logfile} || '/var/log/bind9/query.log';
111 -my $STATEFILE= "$ENV{MUNIN_PLUGSTATE}/bind9.state";
112 +my $STATEFILE= "@@PLUGSTATE@@/bind9.state";
117 open(Q, ">", $STATEFILE);
120 - open(Q,"< $STATEFILE") or die ("Cannot open state file");
121 + open(Q,"< $STATEFILE") or return ("Cannot open state file");
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
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`}
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
142 if($startsize < $pos) {
144 - parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
145 + if (-f $rotlogfile) {
146 + parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
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
156 if($startsize < $pos) {
158 - parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
159 + if (-f $rotlogfile) {
160 + parseLogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
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
170 if ($startsize < $pos) {
172 - parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
173 + if (-f $rotlogfile) {
174 + parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]);
180 while (tell(LOGFILE) < $stop) {
181 my $line = <LOGFILE>;
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
195 -statefile=$MUNIN_PLUGSTATE/plugin-fah_rank.state
196 +statefile=@@PLUGSTATE@@/plugin-fah_rank.state
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
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";
212 + $lister = "/usr/lib/mailman/bin/list_members";
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
222 env.mysqlconnection DBI:mysql:information_schema;host=127.0.0.1;port=3306
224 env.mysqlpassword geheim
225 + env.mysqlnosuperpriv 1
226 env.cachenamespace munin_mysql_pri
228 env.mysqlconnection DBI:mysql:information_schema;host=127.0.0.1;port=13306
230 'user' => $ENV{'mysqluser'} || 'root',
231 'password' => $ENV{'mysqlpassword'} || '',
232 'cache_namespace' => $ENV{'cachenamespace'} || 'munin_mysql',
233 + 'nosuper' => $ENV{'mysqlnosuperpriv'} || 0,
237 @@ -1117,8 +1119,10 @@
238 update_variables($dbh);
239 update_plugins($dbh);
241 - update_master($dbh);
242 - update_slave($dbh);
243 + if (!$config{nosuper}) {
244 + update_master($dbh);
245 + update_slave($dbh);
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
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
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
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
285 if (!$has_requirements) {
286 print "no (missing Net::DNS or Net::IP modules)\n";
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) {
295 print "no (ntpq -p returned no peers)\n";
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 @@
313 -my @associations = `ntpq -c associations`;
314 +my @associations = `/usr/sbin/ntpq -c associations`;
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=([^, ]+)/);
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
337 export PATH=/usr/local/sbin:$PATH
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 |
343 /^estimated error:/ { ev=0; }
344 END { if (ev == 0) { print "yes";} else { print "no (command ntpq or ntpdc not found)"; } exit 0; }'
347 printf 'ntp_err.value '
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) }'
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) }'
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
364 export PATH=/usr/local/sbin:$PATH
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 |
370 /^pll frequency:/ { ev=0; }
371 END { if (ev == 0) { print "yes";} else { print "no (command ntpq or ntpdc not found)"; } exit 0; }'
374 printf 'ntp_pll_freq.value '
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
382 + cmd=/usr/sbin/ntpdc
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
393 export PATH=/usr/local/sbin:$PATH
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 |
399 /^pll offset:/ { ev=0; }
400 END { if (ev == 0) { print "yes";} else { print "no (command ntpq or ntpdc not found)"; } exit 0; }'
403 printf 'ntp_pll_off.value '
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) }'
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) }'
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
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; }
426 - case "$(ntpq -n -p 2>/dev/null | wc -l)" in
427 + case "$(/usr/sbin/ntpq -n -p 2>/dev/null | wc -l)" in
429 echo 'no (unable to list peers)'
435 - syspeer="$(ntpq -n -p | grep '^[*o]')"
436 + syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
438 # shellcheck disable=SC2086
444 - syspeer="$(ntpq -n -p | grep '^[*o]')"
445 + syspeer="$(/usr/sbin/ntpq -n -p | grep '^[*o]')"
447 # shellcheck disable=SC2086
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
454 print "no (missing perl module Net::DNS)\n";
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) {
463 print "no (ntpq -p returned no peers)\n";
465 # 1 63933 931a yes yes none outlier sys_peer 1
466 # 2 63934 943a yes yes none candidate sys_peer 3
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=(.*)/);
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
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'
494 - 'battery_voltage' => {
495 - label => 'batt voltage - V',
499 'battery_runtime' => {
500 label => 'runtime - min',
505 if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
506 - print "graph_title UPS Misc - $config{upsname}\n";
507 + my $s = $config{upsname};
509 + if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
510 + $s .= " at $config{upshost}";
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) {
520 - my $data = `$config{upsc} $config{upsname}`;
521 + my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
522 while ($data =~ /([a-z.]+): (.+)\b/g) {
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
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'
542 - 'input_voltage_maximum' => {
543 - label => 'max input seen',
547 - 'input_voltage_minimum' => {
548 - label => 'min input seen',
552 'output_voltage' => {
558 if ( defined $ARGV[0] and $ARGV[0] eq 'config' ) {
559 - print "graph_title UPS Voltages - $config{upsname}\n";
560 + my $s = $config{upsname};
562 + if ($config{upshost} ne "127.0.0.1" && $config{upshost} ne "localhost") {
563 + $s .= " at $config{upshost}";
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) {
573 - my $data = `$config{upsc} $config{upsname}`;
574 + my $data = `$config{upsc} $config{upsname}\@$config{upshost}`;
575 while ($data =~ /([a-z.]+): (.+)\b/g) {
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
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`}
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
594 if ($startsize < $pos)
597 - parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
598 + if (-f $pop{'rotlogfile'}) {
599 + parseEximfile ($pop{'rotlogfile'}, $pos, (stat $pop{'rotlogfile'})[7]);
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
608 vlabel => 'Scans / sec',
610 "SELECT COALESCE(sum(seq_scan),0) AS sequential, COALESCE(sum(idx_scan),0) AS index FROM pg_stat_user_tables",
611 - paramdatabase => 1,
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
619 . " COALESCE(sum(n_tup_del),0) AS deleted FROM pg_stat_user_tables",
622 - paramdatabase => 1,
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
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
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+$/)
648 next unless grep { $_ } @fields;
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".
658 + /usr/sbin/ip6tables "$@"
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))"
670 @@ -148,10 +148,10 @@
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;}}'
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
697 # one machine answer for several)
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"
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
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
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"
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
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"
732 # Last, if run with the "config"-parameter, quit here (don't
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
738 proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
740 if [ "$1" = "autoconf" ]; then
741 - if [ -f "$NFS" ]; then
742 + if [ -r "$NFS" ]; then
743 if grep -q proc3 "$NFS"; then
751 - split("'"$proc"'", names)
754 - printf("%s.value %d\n", names[++i], values[i+3]);
790 + nfs_readdirplus+=$20
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
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
824 proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
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
837 - split("'"$proc"'", names)
840 - printf("%s.value %d\n", names[++i], values[i+3]);
876 + nfs_readdirplus+=$20
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
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
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";
919 die "Error running iptables. Dying\n" if $?;
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";
930 -die "Error running iptables. Dying\n" if $?;
931 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
933 if ($ARGV[0] and $ARGV[0] eq "config")
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
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";
949 die "Error running iptables. Dying\n" if $?;
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";
960 -die "Error running iptables. Dying\n" if $?;
961 +die "Error running /usr/sbin/iptables. Dying\n" if $?;
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
967 echo 'graph_vlabel ANON pages'
968 echo 'graph_info Shows anonymous memory (human readable) used by each vserver.'
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.'
977 echo 'graph_title Files used by vserver'
978 echo 'graph_args --base 1024k -l 0'
980 echo 'graph_vlabel SHM pages'
981 echo 'graph_info Shows shared memory (human readable) used by each vserver.'
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.'
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.'
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.'
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.'
1008 echo "$RESOURCE not defined."
1010 @@ -301,53 +331,108 @@
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."
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,*"
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,*"
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,*"
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,*"
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,*"
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."
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."
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."
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."
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."
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,*"
1095 + echo "${NAME}_SEMA.label $LABEL: Semaphore arrays"
1096 + echo "${NAME}_SEMA.info Number of semaphore arrays used by $LABEL."
1099 + echo "${NAME}_SEMS.label $LABEL: Semaphores"
1100 + echo "${NAME}_SEMS.info Number of semaphores used by $LABEL."
1103 + echo "${NAME}_DENT.label $LABEL: dentry structs"
1104 + echo "${NAME}_DENT.info Number of dentries used by $LABEL."
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."
1145 echo "$RESOURCE not defined."
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"
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
1167 + "/proc/virtual/$xid/limit"
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"