From 80b2fda42e6b184048a16e796d5fc3df73e61552 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Thu, 18 Jun 2009 15:47:06 +0200 Subject: [PATCH] Don't have to use awk to extract the name if we restrict the fields. --- rabbitmq-consumers | 5 ++--- rabbit-messages => rabbitmq-messages | 5 ++--- rabbitmq-messages_unacknowledged | 5 ++--- rabbitmq-messages_uncommitted | 5 ++--- rabbitmq-queue_memory | 5 ++--- 5 files changed, 10 insertions(+), 15 deletions(-) rename rabbit-messages => rabbitmq-messages (94%) diff --git a/rabbitmq-consumers b/rabbitmq-consumers index e0ede7e..57acfb0 100755 --- a/rabbitmq-consumers +++ b/rabbitmq-consumers @@ -29,10 +29,9 @@ fi # graphs should look. VHOST=${vhost:-"/"} -QUEUE_STATUS=$(sudo rabbitmqctl list_queues -p $VHOST | \ +QUEUES=$(sudo rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ - grep -v 'done.$') -QUEUES=$(echo $QUEUE_STATUS | awk '{print $1}') + grep -v 'done\.$') if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-100} diff --git a/rabbit-messages b/rabbitmq-messages similarity index 94% rename from rabbit-messages rename to rabbitmq-messages index e07b1f3..baee1b0 100755 --- a/rabbit-messages +++ b/rabbitmq-messages @@ -29,10 +29,9 @@ fi # graphs should look. VHOST=${vhost:-"/"} -QUEUE_STATUS=$(sudo rabbitmqctl list_queues -p $VHOST | \ +QUEUES=$(sudo rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ - grep -v 'done.$') -QUEUES=$(echo $QUEUE_STATUS | awk '{print $1}') + grep -v 'done\.$') if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-10000} diff --git a/rabbitmq-messages_unacknowledged b/rabbitmq-messages_unacknowledged index 4901e4b..8a44edd 100755 --- a/rabbitmq-messages_unacknowledged +++ b/rabbitmq-messages_unacknowledged @@ -29,10 +29,9 @@ fi # graphs should look. VHOST=${vhost:-"/"} -QUEUE_STATUS=$(sudo rabbitmqctl list_queues -p $VHOST | \ +QUEUES=$(sudo rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ - grep -v 'done.$') -QUEUES=$(echo $QUEUE_STATUS | awk '{print $1}') + grep -v 'done\.$') if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-10000} diff --git a/rabbitmq-messages_uncommitted b/rabbitmq-messages_uncommitted index 2e31417..b871b7e 100755 --- a/rabbitmq-messages_uncommitted +++ b/rabbitmq-messages_uncommitted @@ -29,10 +29,9 @@ fi # graphs should look. VHOST=${vhost:-"/"} -QUEUE_STATUS=$(sudo rabbitmqctl list_queues -p $VHOST | \ +QUEUES=$(sudo rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ - grep -v 'done.$') -QUEUES=$(echo $QUEUE_STATUS | awk '{print $1}') + grep -v 'done\.$') if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-10000} diff --git a/rabbitmq-queue_memory b/rabbitmq-queue_memory index cf00de1..f788e50 100755 --- a/rabbitmq-queue_memory +++ b/rabbitmq-queue_memory @@ -29,10 +29,9 @@ fi # graphs should look. VHOST=${vhost:-"/"} -QUEUE_STATUS=$(sudo rabbitmqctl list_queues -p $VHOST | \ +QUEUES=$(sudo rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ - grep -v 'done.$') -QUEUES=$(echo $QUEUE_STATUS | awk '{print $1}') + grep -v 'done\.$') if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-10000}