]> git.michaelhowe.org Git - packages/a/afs-monitor.git/commitdiff
rxdebug check for AFS
authorQuanah Gibson-Mount <quanah@stanford.edu>
Thu, 11 Dec 2003 23:59:47 +0000 (23:59 +0000)
committerQuanah Gibson-Mount <quanah@stanford.edu>
Thu, 11 Dec 2003 23:59:47 +0000 (23:59 +0000)
check_rxdebug [new file with mode: 0755]

diff --git a/check_rxdebug b/check_rxdebug
new file mode 100755 (executable)
index 0000000..41dd88f
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/local/bin/perl
+# $Id$
+$rxdebug = '/usr/local/bin/rxdebug';
+@failures=();
+$hiWaterMark=8;
+
+foreach $server (@ARGV) {
+  # Get the output of rxdebug $server -allconn -rxstats
+  open(RXDEBUG, "$rxdebug $server -allconn -rxstats|")
+    || die("Can't open rxdebug\n");
+  $blocked{$server} = 0;
+  while (<RXDEBUG>) {
+      if ( /waiting_for_process/ ) {
+         $blocked{$server}++;
+      }
+  }
+  close(RXDEBUG);
+}
+
+foreach $server (sort keys %blocked) {
+   $blocked=$blocked{$server};
+   if ($blocked >= $hiWaterMark) {
+     push (@failures, "$server blck: $blocked");
+   }
+}
+
+if (@failures == 0) {
+    print "rxdebug OK\n";
+    exit 0;
+}
+
+print "@failures\n";
+exit 2;