Ticket #941 (closed defect: fixed)

Opened 2 years ago

Last modified 3 months ago

bind9_rndc: version number gate fails with debian version numbers

Reported by: feiner.tom Assigned to: nobody
Priority: normal Milestone: Munin 1.4.6
Component: plugins Version: 1.4.4
Severity: normal Keywords:
Cc:

Description (Last modified by feiner.tom)

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;
        }
     }

Change History

07/26/10 20:16:19 changed by feiner.tom

  • description changed.

07/26/10 20:23:39 changed by feiner.tom

  • status changed from new to closed.
  • resolution set to fixed.

Applied patch in trunk and 1.4 stable branch.