Merge pull request #4 from pfigue/erlang_needs_a_home

Adds a HOME env. variable when calling to rabbitmqctl
This commit is contained in:
Ask Solem Hoel 2012-09-12 06:55:21 -07:00
commit 2c377f5a5f
6 changed files with 17 additions and 10 deletions

View File

@ -24,6 +24,8 @@ if [ "$1" = "autoconf" ]; then
exit 0 exit 0
fi fi
HOME=/tmp/
# If run with the "config"-parameter, give out information on how the # If run with the "config"-parameter, give out information on how the
# graphs should look. # graphs should look.
@ -61,4 +63,4 @@ fi
# real work - i.e. display the data. Almost always this will be # real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field. # "value" subfield for every data field.
echo "connections.value $(rabbitmqctl list_connections | grep -v "^Listing" | grep -v "done.$" | wc -l)" echo "connections.value $(HOME=$HOME rabbitmqctl list_connections | grep -v "^Listing" | grep -v "done.$" | wc -l)"

View File

@ -28,8 +28,9 @@ fi
# If run with the "config"-parameter, give out information on how the # If run with the "config"-parameter, give out information on how the
# graphs should look. # graphs should look.
HOME=/tmp/
VHOST=${vhost:-"/"} VHOST=${vhost:-"/"}
QUEUES=$(rabbitmqctl list_queues -p $VHOST name | \ QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
grep -v '^Listing' | \ grep -v '^Listing' | \
grep -v 'done\.$' | sed -e 's/[.-=]/_/g' ) grep -v 'done\.$' | sed -e 's/[.-=]/_/g' )
@ -69,6 +70,6 @@ fi
# real work - i.e. display the data. Almost always this will be # real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field. # "value" subfield for every data field.
rabbitmqctl list_queues -p $VHOST name consumers| \ HOME=$HOME rabbitmqctl list_queues -p $VHOST name consumers| \
grep -v "^Listing" | grep -v "done.$" | \ grep -v "^Listing" | grep -v "done.$" | \
perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")' perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'

View File

@ -28,8 +28,9 @@ fi
# If run with the "config"-parameter, give out information on how the # If run with the "config"-parameter, give out information on how the
# graphs should look. # graphs should look.
HOME=/tmp/
VHOST=${vhost:-"/"} VHOST=${vhost:-"/"}
QUEUES=$(rabbitmqctl list_queues -p $VHOST name | \ QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
grep -v '^Listing' | \ grep -v '^Listing' | \
grep -v 'done\.$' | sed -e 's/[.-=]/_/g' ) grep -v 'done\.$' | sed -e 's/[.-=]/_/g' )
@ -69,6 +70,6 @@ fi
# real work - i.e. display the data. Almost always this will be # real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field. # "value" subfield for every data field.
rabbitmqctl list_queues -p $VHOST | \ HOME=$HOME rabbitmqctl list_queues -p $VHOST | \
grep -v "^Listing" | grep -v "done.$" | \ grep -v "^Listing" | grep -v "done.$" | \
perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")' perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'

View File

@ -28,8 +28,9 @@ fi
# If run with the "config"-parameter, give out information on how the # If run with the "config"-parameter, give out information on how the
# graphs should look. # graphs should look.
HOME=/tmp/
VHOST=${vhost:-"/"} VHOST=${vhost:-"/"}
QUEUES=$(rabbitmqctl list_queues -p $VHOST name | \ QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
grep -v '^Listing' | \ grep -v '^Listing' | \
grep -v 'done\.$' | sed -e 's/[.-=]/_/g' ) grep -v 'done\.$' | sed -e 's/[.-=]/_/g' )
@ -69,6 +70,6 @@ fi
# real work - i.e. display the data. Almost always this will be # real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field. # "value" subfield for every data field.
rabbitmqctl list_queues -p $VHOST name messages_unacknowledged | \ HOME=$HOME rabbitmqctl list_queues -p $VHOST name messages_unacknowledged | \
grep -v "^Listing" | grep -v "done.$" | \ grep -v "^Listing" | grep -v "done.$" | \
perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")' perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'

View File

@ -28,8 +28,9 @@ fi
# If run with the "config"-parameter, give out information on how the # If run with the "config"-parameter, give out information on how the
# graphs should look. # graphs should look.
HOME=/tmp/
VHOST=${vhost:-"/"} VHOST=${vhost:-"/"}
QUEUES=$(rabbitmqctl list_queues -p $VHOST name | \ QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
grep -v '^Listing' | \ grep -v '^Listing' | \
grep -v 'done\.$' | sed -e 's/[.-=]/_/g' ) grep -v 'done\.$' | sed -e 's/[.-=]/_/g' )
@ -69,6 +70,6 @@ fi
# real work - i.e. display the data. Almost always this will be # real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field. # "value" subfield for every data field.
rabbitmqctl list_queues -p $VHOST name messages_uncommitted | \ HOME=$HOME rabbitmqctl list_queues -p $VHOST name messages_uncommitted | \
grep -v "^Listing" | grep -v "done.$" | \ grep -v "^Listing" | grep -v "done.$" | \
perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")' perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'

View File

@ -28,6 +28,7 @@ fi
# If run with the "config"-parameter, give out information on how the # If run with the "config"-parameter, give out information on how the
# graphs should look. # graphs should look.
HOME=/tmp/
VHOST=${vhost:-"/"} VHOST=${vhost:-"/"}
QUEUES=$(rabbitmqctl list_queues -p $VHOST name | \ QUEUES=$(rabbitmqctl list_queues -p $VHOST name | \
grep -v '^Listing' | \ grep -v '^Listing' | \
@ -69,6 +70,6 @@ fi
# real work - i.e. display the data. Almost always this will be # real work - i.e. display the data. Almost always this will be
# "value" subfield for every data field. # "value" subfield for every data field.
rabbitmqctl list_queues -p $VHOST name memory | \ HOME=$HOME rabbitmqctl list_queues -p $VHOST name memory | \
grep -v "^Listing" | grep -v "done.$" | \ grep -v "^Listing" | grep -v "done.$" | \
perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")' perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'