SF.net SVN: logwatch:[163] scripts/services/named

[email protected]
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Revision: 163
          http://sourceforge.net/p/logwatch/code/163
Author:   stefjakobs
Date:     2013-08-19 10:17:44 +0000 (Mon, 19 Aug 2013)
Log Message:
-----------
named: structure output of unexpected RCODEs

Modified Paths:
--------------
    scripts/services/named

Modified: scripts/services/named
===================================================================
--- scripts/services/named	2013-08-19 10:15:32 UTC (rev 162)
+++ scripts/services/named	2013-08-19 10:17:44 UTC (rev 163)
@@ -350,8 +350,8 @@
       $NonAuthoritative{$Zone}++;
    } elsif ( ($Zone) = ($ThisLine =~ /zone ([^\/]+)\/.+: refresh: retry limit for master \S+ exceeded/) ) {
       $RetryLimit{$Zone}++; 
-   } elsif ( ($ThisLine =~ /(?:error \()?unexpected RCODE\)? \(?(.*?)\)? resolving/) ){
-      $UnexpRCODE{$1}++;
+   } elsif ( ($Rcode, $Zone, $Host) = ($ThisLine =~ /(?:error \()?unexpected RCODE\)? \(?(.*?)\)? resolving '(.*)': (.*)$/) ){
+      $UnexpRCODE{$Rcode}{$Zone}{$Host}++;
    } elsif ( ($ThisLine =~ /(?:error \()?FORMERR\)? resolving '[^ ]+: [.0-9a-fA-F:#]+/) or
              ($ThisLine =~ /DNS format error from [^ ]+ resolving [^ ]+( for client [^ ]+)?: .*/) ) {
       chomp($ThisLine);
@@ -662,8 +662,14 @@
 
 if (($Detail >= 5) and (keys %UnexpRCODE)) {
    print "\n Unexpected DNS RCODEs:\n";
-   foreach $ThisOne (keys %UnexpRCODE) {
-      print "   " . $ThisOne . ": " . $UnexpRCODE{$ThisOne} . " Time(s)\n";
+   foreach $ThisOne (sort {$a cmp $b} keys %UnexpRCODE) {
+      print "   " . $ThisOne . ":\n";
+      foreach $Zone (sort {$a cmp $b} keys %{$UnexpRCODE{$ThisOne}}) {
+         print "     " . $Zone . ":\n";
+         foreach $Host (sort SortIP keys %{$UnexpRCODE{$ThisOne}{$Zone}}) {
+            print "         " . $Host . ": " . $UnexpRCODE{$ThisOne}{$Zone}{$Host} . " Time(s)\n";
+         }
+      }
    }
 }
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.