SF.net SVN: logwatch:[267] trunk/scripts/services/freeradius

[email protected] Wed, 19 Nov 2014 17:35:30 +0000
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Revision: 267
          http://sourceforge.net/p/logwatch/code/267
Author:   stefjakobs
Date:     2014-11-19 17:35:28 +0000 (Wed, 19 Nov 2014)
Log Message:
-----------
freeradius: report long running requests

Modified Paths:
--------------
    trunk/scripts/services/freeradius

Modified: trunk/scripts/services/freeradius
===================================================================
--- trunk/scripts/services/freeradius	2014-11-12 10:29:44 UTC (rev 266)
+++ trunk/scripts/services/freeradius	2014-11-19 17:35:28 UTC (rev 267)
@@ -35,6 +35,8 @@
 my %warnings = ();
 my %givingUps = ();
 my $killedChilds = 0;
+my $requests = 0;
+my $requests_duration = 0;
 
 my $ThisLine;
 while (defined($ThisLine = <STDIN>)) {
@@ -108,9 +110,15 @@
       $killedChilds++;
    }
 
+   # TD: Request 67678577 has been waiting in the processing queue for 378 seconds.  Check that all databases are running properly!
+   elsif ($ThisLine =~ m/^Request \d+ has been waiting in the processing queue for (\d+) seconds/) {
+      $requests++;
+      $requests_duration += $1;
+   }
+
    # TD: WARNING: Unresponsive child for request 4737598, in component accounting module unix
    # TD: WARNING: Child is hung for request 4737598 in component accounting module unix.
-   elsif ( $ThisLine =~ m/^WARNING: (Unresponsive child|Child is hung) for request \d+,? in component (\w+) module ?(\w*)/ ) {
+   elsif ( $ThisLine =~ m/^WARNING: (Unresponsive child|Child is hung) for request \d+,? in component ([<>\w]+) module ?([<>\w]*)/ ) {
       $warnings{"$1 in component:"}{"$2 [module: $3]"}++;
    }
 
@@ -130,6 +138,14 @@
 # Output section
 ################################
 
+if ($requests > 0) {
+   printf "Long running requests: Check that all databases are running properly!\n";
+   printf "  %-40s : %5d\n", 'Long running requests', $requests;
+   printf "  %-40s : %5d s\n", 'avg queue time per long running request', $requests_duration / $requests;
+   print "\n";
+}
+
+
 sub compPerIp {
   return $wrong_ip{$b} <=> $wrong_ip{$a};
 }

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


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk