Forwarded from : http://bugs.debian.org/573750:
I'm running munin-node from testing on a couple of lenny hosts with bind9.
The bind9_rndc plugin behaves different based on the version number of
rndc, because statistics output changed in bind 9.6.
However, the version in lenny (which is 9.5.1-P3) already uses the new
statistics format, but is not recognized by the script as such.
The plugin tries to parse the new stat output using code intended to
parse the old format, resulting in the following error message:
Error output from bind9_rndc:
Use of uninitialized value $IN{"[Common]"} in concatenation (.) or
string at /etc/munin/plugins/bind9_rndc line 209.
The version number being parsed is read from the output of the bind tool "rndc", which prints
Version: Version: 9.6-ESV-R1
as last line when executed without arguments.
The script uses the following regular expression to get the minor version number from this line:
/Version:\s+9\.(\d+)\./o
Obviously, because this regex expects a dot after the "6", it doesn't match the line. I suggest changing the last delimiter to any non-digit:
/Version:\s+9\.(\d+)\D/o
Patch follows:
- --- bind9_rndc.dist 2010-07-11 15:29:27.000000000 +0200
+++ bind9_rndc 2010-07-18 20:56:45.000000000 +0200
@@ -63,7 +63,7 @@
# check to see if we're running bind 9.6
if ( open VERSION, "$rndc 2>&1 |" ) {
while ( my $line = <VERSION> ) {
- - if ( $line =~ m/^Version:\s+9\.(\d+)\./o ) {
+ if ( $line =~ m/^Version:\s+9\.(\d+)\D/o ) {
$version96 = 1 if $1 >= 6;
}
}