Ticket #627 (closed defect: fixed)

Opened 3 years ago

Last modified 3 months ago

"bind9_rndc" patch for supporting BIND9.5 named.stats

Reported by: kano Assigned to: nobody
Priority: normal Milestone: Munin 1.4
Component: plugins Version: 1.2.6
Severity: normal Keywords:
Cc:

Description

Hi, there.

Munin 1.2.6's default plugin "bind9_rndc" does not work in BIND9.5, since "var/named.stats" format has changed so.

Following is new BIND9.5 "named.stats" output.

--- Statistics Dump --- (1222738621)
+++ Statistics Dump +++ (1222740363)
++ Incoming Requests ++
                  13 QUERY
++ Incoming Queries ++
                   9 A
                   1 NS
                   1 SOA
                   1 MX
                   1 TXT
++ Outgoing Queries ++
++ Name Server Statistics ++
                  13 IPv4 requests received
                  13 responses sent
                  13 queries resulted in successful answer
                   9 queries resulted in authoritative answer
                   4 queries resulted in non authoritative answer
                   4 queries caused recursion
++ Zone Maintenance Statistics ++
                   6 IPv4 notifies sent

I made a patch to fix it. It supports both classical BIND9.3 and BIND9.5.

--- ./build/node/node.d/bind9_rndc.orig 2008-09-30 13:12:12.000000000 +0900
+++ ./build/node/node.d/bind9_rndc      2008-09-30 13:18:14.000000000 +0900
@@ -41,6 +41,7 @@
 open(my $stats, '<', $querystats) or die "$querystats: $!\n";
 seek($stats , 400, -1);                # go nearly to the end of the file
                                # to avoid reading it all
+my $mode = 0;                   # 0=Bind9.3, 1=Bind9.5

 while (my $line = <$stats>) {
     chomp $line;
@@ -58,6 +59,17 @@
     if ($line =~ m/\+\+\+ Statistics Dump \+\+\+/) {
        # reset
        undef %IN;
+    } elsif ($line =~ m/\+\+ Name Server Statistics \+\+/) {
+       undef %IN;
+       $mode = 1;
+
+    } elsif( $mode == 1 ) {
+       my($i,$s) = $line =~ m/^\s+(\d+) (.*)/  or next;
+       $s =~ /(successful answer|(?:non )?authoritative answer|recursion)/  or next;
+       my $key = $1;
+       $key =~ s/ /_/g;
+       $IN{$key} = $i;
+
     } else {
        my ($what, $nb)= split('\s+', $line);
        if ($what && ($what ne '---')) {

BIND9.5 plugin output sample.

query_recursion.value 7
query_authoritative_answer.value 37
query_successful_answer.value 43
query_non_authoritative_answer.value 8

I checked on BIND9.5.0-P2 and BIND9.3.4-P1.

Thanks.

K.Kano. <<kano@feena.jp>>

Attachments

bind9_rndc_new (4.9 kB) - added by vrivellino on 06/13/09 05:25:15.
New bind9_rndc plugin. Supports stats generated by 9.6, as well as older stats. Backward compatible with current bind9_rndc.

Change History

06/13/09 05:25:15 changed by vrivellino

  • attachment bind9_rndc_new added.

New bind9_rndc plugin. Supports stats generated by 9.6, as well as older stats. Backward compatible with current bind9_rndc.

10/21/09 02:36:51 changed by janl

  • milestone set to Munin 1.4.

11/20/09 13:52:22 changed by janl

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

Added vrivellinos version (slightly edited) in r3021

10/27/11 12:16:41 changed by kannperlice1983

Anyone who loves movies is more likely to love film downloads, too. The very fact is that this development is turning into a big one and it is great for many who wish to create large collections without having to dole out top greenback or premium home space to do so. How to download from vimeo at the moment are available legally from all kinds of massive movie studios and even television networks, as well. A video collection created digitally has a number of benefits over regular disk purchases, too. The most important perks of video downloads involve the storage points and pricing. However, why? Video downloads are usually a number of dollars or extra less than a regular DVD purchase as a result of there is no such thing as a packaging points to contend with. Plus, there's the straightforward reality delivery is not a problem either. For the reason that corporations that sell downloads save on transport and the movie studios save on packaging, they'll move on some of these savings directly to buyers. In regard to storage, it's a easy fact of space. It's a whole lot simpler to store motion pictures on a pc drive or a backup drive than it's to hold 100 videos in a room. There is no need for shelf after shelf or tons of DVD towers when a collection is created by way of video download. Administration of movies and tv downloads generally is a complete lot easier, too. It is pretty easy to create folders on the computer to store films by style and it is a complete lot quicker, too. Video downloads have gotten the favorites of many for a purpose past storage or pricing. This purpose is variety. The actual fact is the sorts of downloads out there will be actually thoughts boggling. Let us take a look at what kinds of video downloads might be found legally: Hit motion pictures Nearly each new movie that hits the theaters will find yourself in a authorized obtain format shortly after release. This means there is no have to run to the video retailer, or worse, pay prime greenback at a theater to see a new release. Television programs Vimeo tube downloads Because the film studios soar on the bandwagon, so too are the tv studios. Hit exhibits from all many years might be discovered by the season or by the episode through video download.Classics Because the film obtain business turns into more common, many studios are video by way of their catalogues and offering downloads of their older movies. From the classics of the Nineteen Twenties to vacation favorites of the 1980s, they can all be discovered through video download. And, if a title can't be found right now, it is doubtless it is going to be added soon as each main film studio falls into place providing downloads by way of a lot of totally different sites. Video downloads provide their customers with an on demand aspect, worth savings and storage issue discount that regular DVD buys cannot. As this new format becomes an increasing number of accepted, it's changing into the strategy of alternative for purchasing and watching movies. Unique works There are tons of places to get video downloads from novice or little identified creators. These videos might not have the financial backing of a few of the main films in historical past, however that does not mean there isn't some good leisure out there. Indie works are getting a complete new viewers due to video downloads and the Internet.