qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r732340 - in /qpid/trunk/qpid/java/broker/scripts: ./ resetAlerting.sh
Date Wed, 07 Jan 2009 13:56:40 GMT
Author: aidan
Date: Wed Jan  7 05:56:38 2009
New Revision: 732340

URL: http://svn.apache.org/viewvc?rev=732340&view=rev
Log:
Add script to reset the alerting levels, which were broken in M2.1

Added:
    qpid/trunk/qpid/java/broker/scripts/
    qpid/trunk/qpid/java/broker/scripts/resetAlerting.sh

Added: qpid/trunk/qpid/java/broker/scripts/resetAlerting.sh
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/scripts/resetAlerting.sh?rev=732340&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/scripts/resetAlerting.sh (added)
+++ qpid/trunk/qpid/java/broker/scripts/resetAlerting.sh Wed Jan  7 05:56:38 2009
@@ -0,0 +1,58 @@
+#!/bin/bash
+#
+# Alerting Rest Scripts to renabled the alerts on the queue.
+#
+# Defaults to Localhost broker
+#
+
+CLI=./build/bin/qpid-cli
+OUTPUT=0
+
+
+resetQueue()
+{
+    vhost=$1
+    queue=$2
+    echo "Resetting Values for $queue on $vhost"    
+    rawQDepth=`$CLI get -o queue -v $vhost -n $queue  -a MaximumQueueDepth`
+    # Note that MaxQueDepth is returned as Kb but set as b!
+    queueDepth=$[ $rawQDepth * 1024 ]
+    messageAge=`$CLI get -o queue -v $vhost -n $queue  -a MaximumMessageAge`
+    messageCount=`$CLI get -o queue -v $vhost -n $queue  -a MaximumMessageCount`
+    messageSize=`$CLI get -o queue -v $vhost -n $queue  -a MaximumMessageSize` 
+    
+    if [ $OUTPUT == 1 ] ; then    
+     echo Current Values:
+     echo MaximumQueueDepth   : $queueDepth
+     echo MaximumMessageAge   : $messageAge
+     echo MaximumMessageCount : $messageCount
+     echo MaximumMessageSize  : $messageSize        
+    fi
+    
+    $CLI set -o queue -v $vhost -n $queue  -a MaximumMessageSize -s $messageSize
+    $CLI set -o queue -v $vhost -n $queue  -a MaximumMessageAge -s $messageAge
+    $CLI set -o queue -v $vhost -n $queue  -a MaximumMessageCount -s $messageCount
+    $CLI set -o queue -v $vhost -n $queue  -a MaximumQueueDepth -s $queueDepth	    
+}
+
+resetVirtualHost()
+{
+ vhost=$1
+ ignore=0
+ for queue in `$CLI list -o queue -v $vhost |grep '|' | cut -d '|' -f 1 ` ; do
+ 
+   if [ $ignore == 0 ] ; then
+     ignore=1
+   else
+     resetQueue $vhost $queue
+   fi
+ 
+ done
+}
+
+for vhost in `$CLI list -o virtualhost|grep VirtualHost|cut -d '=' -f 3` ; do
+
+ resetVirtualHost $vhost
+ 
+done
+



Mime
View raw message