Permalink
Browse files

Merge pull request #269 from Eleme/master

Update to a better rabbitmq munin plugin
  • Loading branch information...
2 parents 2a31f93 + 5f8bf7e commit ac8f4636bbdc7d94f718f42893a1f6e3feb4e353 @kenyon kenyon committed Mar 13, 2013
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-
-#Author: Juned Memon
-#www.TipsNtrapS.com
-#mail:juned.memon@tipsntraps.com
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
-
-if [ "$1" = "autoconf" ]; then
- echo yes
- exit 0
-fi
-
-# If run with the "config"-parameter, give out information on how the
-# graphs should look.
-
-if [ "$1" = "config" ]; then
-
-
- # The title of the graph
- echo 'graph_title RabbitMQ connections'
- # Arguments to "rrdtool graph". In this case, tell it that the
- # lower limit of the graph is '0', and that 1k=1000 (not 1024)
- echo 'graph_args --base 1000 -l 0'
- # The Y-axis label
- echo 'graph_vlabel connections'
- # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
- # 420 milliload)
- #echo 'graph_scale no'
- echo 'graph_category RabbitMQ'
-
- echo "connections.label Connections"
- echo "connections.warning 500"
- echo "connections.critical 1000"
- echo "connections.info Number of active connections"
-
- echo 'graph_info Shows the number of connections to RabbitMQ'
- # Last, if run with the "config"-parameter, quit here (don't
- # display any data)
- exit 0
-fi
-
-# If not run with any parameters at all (or only unknown ones), do the
-# real work - i.e. display the data. Almost always this will be
-# "value" subfield for every data field.
-
-echo "connections.value $(rabbitmqctl list_connections -q | wc -l)"
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-
-#Author: Juned Memon
-#www.TipsNtrapS.com
-#mail:juned.memon@tipsntraps.com
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
-
-if [ "$1" = "autoconf" ]; then
- echo yes
- exit 0
-fi
-
-# If run with the "config"-parameter, give out information on how the
-# graphs should look.
-
-VHOST="/"
-QUEUE="ViApiQueue"
-
-if [ "$1" = "config" ]; then
-
- # The title of the graph
- echo "graph_title RabbitMQ $VHOST consumers"
- # Arguments to "rrdtool graph". In this case, tell it that the
- # lower limit of the graph is '0', and that 1k=1000 (not 1024)
- echo 'graph_args --base 1000 -l 0'
- # The Y-axis label
- echo 'graph_vlabel consumers'
- # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
- # 420 milliload)
- #echo 'graph_scale no'
- echo 'graph_category RabbitMQ'
-
- echo "$QUEUE.label $QUEUE"
- echo "$QUEUE.warning $QUEUE_WARN"
- echo "$QUEUE.critical $QUEUE_CRIT"
- echo "$QUEUE.info Active consumers for $QUEUE"
-
- echo 'graph_info Lists active consumers for a queue.'
- # Last, if run with the "config"-parameter, quit here (don't
- # display any data)
- exit 0
-fi
-# If not run with any parameters at all (or only unknown ones), do the
-# real work - i.e. display the data. Almost always this will be
-# "value" subfield for every data field.
-rabbitmqctl list_queues -p $VHOST name consumers -q | grep $QUEUE |perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'
@@ -1,52 +0,0 @@
-#!/bin/sh
-#
-
-#Author: Juned Memon
-#www.TipsNtrapS.com
-#mail:juned.memon@tipsntraps.com
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
-
-if [ "$1" = "autoconf" ]; then
- echo yes
- exit 0
-fi
-
-# If run with the "config"-parameter, give out information on how the
-# graphs should look.
-
-VHOST="/"
-QUEUE="ViApiQueue"
-
-if [ "$1" = "config" ]; then
-
- # The title of the graph
- echo "graph_title RabbitMQ $VHOST Number of Messages in queue $QUEUE"
- # Arguments to "rrdtool graph". In this case, tell it that the
- # lower limit of the graph is '0', and that 1k=1000 (not 1024)
- echo 'graph_args --base 1000 -l 0'
- # The Y-axis label
- echo 'graph_vlabel queue_size'
- # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
- # 420 milliload)
- #echo 'graph_scale no'
- echo 'graph_category RabbitMQ'
-
- echo "$QUEUE.label $QUEUE"
- echo "$QUEUE.warning 10"
- echo "$QUEUE.critical 20"
- echo "$QUEUE.info Queue size for $QUEUE"
-
- echo "graph_info Lists how many messages are in queue $QUEUE"
- # Last, if run with the "config"-parameter, quit here (don't
- # display any data)
- exit 0
-fi
-
-# If not run with any parameters at all (or only unknown ones), do the
-# real work - i.e. display the data. Almost always this will be
-# "value" subfield for every data field.
-rabbitmqctl list_queues -p $VHOST -q | grep $QUEUE |perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-
-#Author: Juned Memon
-#www.TipsNtrapS.com
-#mail:juned.memon@tipsntraps.com
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
-
-if [ "$1" = "autoconf" ]; then
- echo yes
- exit 0
-fi
-
-# If run with the "config"-parameter, give out information on how the
-# graphs should look.
-
-VHOST="/"
-QUEUE="ViApiQueue"
-
-if [ "$1" = "config" ]; then
-
- # The title of the graph
- echo "graph_title RabbitMQ $VHOST Unacknowledged Messages"
- # Arguments to "rrdtool graph". In this case, tell it that the
- # lower limit of the graph is '0', and that 1k=1000 (not 1024)
- echo 'graph_args --base 1000 -l 0'
- # The Y-axis label
- echo 'graph_vlabel unacknowledged'
- # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
- # 420 milliload)
- #echo 'graph_scale no'
- echo 'graph_category RabbitMQ'
-
- echo "$QUEUE.label $QUEUE"
- echo "$QUEUE.warning 10000"
- echo "$QUEUE.critical 20000"
- echo "$QUEUE.info Unacknowledged messages for $QUEUE"
-
- echo "graph_info Lists how many Unacknowledged messages in queue $QUEUE"
- # Last, if run with the "config"-parameter, quit here (don't
- # display any data)
- exit 0
-fi
-# If not run with any parameters at all (or only unknown ones), do the
-# real work - i.e. display the data. Almost always this will be
-# "value" subfield for every data field.
-rabbitmqctl list_queues -p $VHOST name messages_unacknowledged -q | grep $QUEUE |perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'
@@ -1,54 +0,0 @@
-#!/bin/sh
-#
-
-#Author: Juned Memon
-#www.TipsNtrapS.com
-#mail:juned.memon@tipsntraps.com
-
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
-
-if [ "$1" = "autoconf" ]; then
- echo yes
- exit 0
-fi
-
-# If run with the "config"-parameter, give out information on how the
-# graphs should look.
-
-VHOST="/"
-QUEUE="ViApiQueue"
-
-if [ "$1" = "config" ]; then
-
- # The title of the graph
- echo "graph_title RabbitMQ $VHOST Memory used by $QUEUES"
- # Arguments to "rrdtool graph". In this case, tell it that the
- # lower limit of the graph is '0', and that 1k=1000 (not 1024)
- echo 'graph_args --base 1024 --vertical-label Bytes -l 0'
- # The Y-axis label
- echo 'graph_vlabel memory'
- # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
- # 420 milliload)
- #echo 'graph_scale no'
- echo 'graph_category RabbitMQ'
-
- echo "$QUEUE.label $QUEUE"
- echo "$QUEUE.warning 80000"
- echo "$QUEUE.critical 90000"
- echo "$QUEUE.info Memory used by $QUEUE"
-
- echo "graph_info Show memory usage by queue $QUEUE"
-
- # Last, if run with the "config"-parameter, quit here (don't
- # display any data)
- exit 0
-fi
-
-# If not run with any parameters at all (or only unknown ones), do the
-# real work - i.e. display the data. Almost always this will be
-# "value" subfield for every data field.
-rabbitmqctl list_queues -p $VHOST name memory -q | grep $QUEUE |perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'
@@ -1,81 +0,0 @@
-#!/bin/sh
-#
-# Plugin to monitor the queues of a virtual_host in RabbitMQ
-#
-# Usage: Link or copy into /etc/munin/node.d/
-#
-# Parameters
-# env.vhost <AMQ virtual host>
-# env.queue_warn <warning queuesize>
-# env.queue_crit <critical queuesize>
-#
-# Magic markers (optional - only used by munin-config and some
-# installation scripts):
-#
-#%# family=auto
-#%# capabilities=autoconf
-
-# If run with the "autoconf"-parameter, give our opinion on wether we
-# should be run on this system or not. This is optinal, and only used by
-# munin-config. In the case of this plugin, we should most probably
-# always be included.
-
-
-###########################################################################################################
-
-#rabbitmq-througput : This plugin captures the througput of the rabbitmq server i.e rate of messages (published,acknoledged,deliver and deliver_get) per second. These values are captured from RabbitMQ management plugin.
-
-#Authour : Juned Memon
-#Website : www.TipsNtrapS.com
-#Email : junedm@tipsntraps.com
-#Version :1.0
-
-#NOTE : Chnage the URL to access the UI of RabbitMQ management
-
-###########################################################################################################
-
-if [ "$1" = "autoconf" ]; then
- echo yes
- exit 0
-fi
-
-curl -f -u guest:guest http://localhost:55672/api/overview | awk -F \" '{print $14"_"$16$17"\n"$22"_"$24$25"\n"$30"_"$32$33"\n"$38"_"$40$41}' | awk -F[:,] 'BEGIN {ORS = ""}{print $1} {printf" %2.4f\n",$2}' > /tmp/Throuphput.txt
-
-
-details=$(cat /tmp/Throuphput.txt |awk '{print $1}')
-# If run with the "config"-parameter, give out information on how the
-# graphs should look.
-
-if [ "$1" = "config" ]; then
-
- # The title of the graph
- echo "graph_title RabbitMQ Throughput"
- # Arguments to "rrdtool graph". In this case, tell it that the
- # lower limit of the graph is '0', and that 1k=1000 (not 1024)
- echo 'graph_args --base 1000 --vertical-label Bytes -l 0'
- # The Y-axis label
- echo 'graph_vlabel Throuphput'
- # We want Cur/Min/Avg/Max unscaled (i.e. 0.42 load instead of
- # 420 milliload)
- #echo 'graph_scale no'
- echo 'graph_category RabbitMQ'
-
-
-for detail in $details; do
- echo "$detail.label $detail"
- echo "$detail.info rate of $detail"
- done
-
- echo "graph_info Show Throughput for RabbitMQ "
-
- # Last, if run with the "config"-parameter, quit here (don't
- # display any data)
- exit 0
-fi
-
-# If not run with any parameters at all (or only unknown ones), do the
-# real work - i.e. display the data. Almost always this will be
-# "value" subfield for every data field.
-
-cat /tmp/Throuphput.txt | perl -nle'($q, $s) = split; $q =~ s/[.-=]/_/g; print("$q.value $s")'
-rm /tmp/Throuphput.txt
Oops, something went wrong.

0 comments on commit ac8f463

Please sign in to comment.