Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #269 from Eleme/master

Update to a better rabbitmq munin plugin
  • Loading branch information...
commit ac8f4636bbdc7d94f718f42893a1f6e3feb4e353 2 parents 2a31f93 + 5f8bf7e
@kenyon kenyon authored
View
51 plugins/rabbitmq/rabbitmq-connections
@@ -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)"
View
51 plugins/rabbitmq/rabbitmq-consumers
@@ -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")'
View
52 plugins/rabbitmq/rabbitmq-messages
@@ -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")'
View
51 plugins/rabbitmq/rabbitmq-messages_unacknowledged
@@ -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")'
View
54 plugins/rabbitmq/rabbitmq-queue_memory
@@ -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")'
View
81 plugins/rabbitmq/rabbitmq-throughput
@@ -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
View
66 plugins/rabbitmq/rabbitmq_connections
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of connections to RabbitMQ
+#
+# Usage: Link or copy into /etc/munin/node.d/
+#
+# Parameters
+# env.conn_warn <warning connections>
+# env.conn_crit <critical connections>
+#
+# 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.
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+HOME=/tmp/
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+if [ "$1" = "config" ]; then
+ CONN_WARN=${queue_warn:-500}
+ CONN_CRIT=${queue_crit:-1000}
+
+ # The host name this plugin is for. (Can be overridden to have
+ # one machine answer for several)
+
+ # 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 $CONN_WARN"
+ echo "connections.critical $CONN_CRIT"
+ 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 $(HOME=$HOME rabbitmqctl list_connections | grep -v "^Listing" | grep -v "done.$" | wc -l)"
View
75 plugins/rabbitmq/rabbitmq_consumers
@@ -0,0 +1,75 @@
+#!/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.
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+HOME=/tmp/
+VHOST=${vhost:-"/"}
+QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
+ grep -v '^Listing' | \
+ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' )
+
+if [ "$1" = "config" ]; then
+ QUEUE_WARN=${queue_warn:-100}
+ QUEUE_CRIT=${queue_crit:-500}
+
+ # The host name this plugin is for. (Can be overridden to have
+ # one machine answer for several)
+
+ # 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'
+
+ for queue in $QUEUES; do
+ echo "$queue.label $queue"
+ echo "$queue.warning $QUEUE_WARN"
+ echo "$queue.critical $QUEUE_CRIT"
+ echo "$queue.info Active consumers for $queue"
+ done
+
+ 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.
+
+HOME=$HOME rabbitmqctl list_queues -p $VHOST name consumers| \
+ grep -v "^Listing" | grep -v "done.$" | \
+ perl -nle'($q, $s) = split; $q =~ s/[.=-]/_/g; print("$q.value $s")'
View
36 plugins/rabbitmq/rabbitmq_list_queues
@@ -1,36 +0,0 @@
-#!/usr/bin/tclsh
-
-proc clean_fieldname arg {
- return [regsub -all {[^A-Za-z]} $arg "_"]
-}
-
-proc main {argc argv} {
- set queues [exec /usr/sbin/rabbitmqctl list_queues -q]
- if {$argc > 0} {
- switch [lindex $argv 0] {
- "config" {
- puts "graph_title Number of messages in RabbitMQ queues"
- puts "graph_vlabel messages"
- puts "graph_category RabbitMQ"
- foreach {q m} $queues {
- set clean [clean_fieldname $q]
- puts "$clean.label $q"
- puts "$clean.draw LINE3"
- puts "$clean.warning 300000"
- puts "$clean.critical 700000"
- }
- }
- "autoconf" {
- puts "yes"
- }
- }
- } else {
- foreach {q m} $queues {
- set clean [clean_fieldname $q]
- puts "$clean.value $m"
- }
- }
-}
-
-main $argc $argv
-
View
75 plugins/rabbitmq/rabbitmq_messages
@@ -0,0 +1,75 @@
+#!/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.
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+HOME=/tmp/
+VHOST=${vhost:-"/"}
+QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
+ grep -v '^Listing' | \
+ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' )
+
+if [ "$1" = "config" ]; then
+ QUEUE_WARN=${queue_warn:-10000}
+ QUEUE_CRIT=${queue_crit:-20000}
+
+ # The host name this plugin is for. (Can be overridden to have
+ # one machine answer for several)
+
+ # The title of the graph
+ echo "graph_title RabbitMQ $VHOST list_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 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'
+
+ for queue in $QUEUES; do
+ echo "$queue.label $queue"
+ echo "$queue.warning $QUEUE_WARN"
+ echo "$queue.critical $QUEUE_CRIT"
+ echo "$queue.info Queue size for $queue"
+ done
+
+ echo 'graph_info Lists how many messages are in each 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.
+
+HOME=$HOME rabbitmqctl list_queues -p $VHOST | \
+ grep -v "^Listing" | grep -v "done.$" | \
+ perl -nle'($q, $s) = split; $q =~ s/[.=-]/_/g; print("$q.value $s")'
View
75 plugins/rabbitmq/rabbitmq_messages_unacknowledged
@@ -0,0 +1,75 @@
+#!/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.
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+HOME=/tmp/
+VHOST=${vhost:-"/"}
+QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
+ grep -v '^Listing' | \
+ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' )
+
+if [ "$1" = "config" ]; then
+ QUEUE_WARN=${queue_warn:-10000}
+ QUEUE_CRIT=${queue_crit:-20000}
+
+ # The host name this plugin is for. (Can be overridden to have
+ # one machine answer for several)
+
+ # 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'
+
+ for queue in $QUEUES; do
+ echo "$queue.label $queue"
+ echo "$queue.warning $QUEUE_WARN"
+ echo "$queue.critical $QUEUE_CRIT"
+ echo "$queue.info Unacknowledged messages for $queue"
+ done
+
+ echo 'graph_info Lists how many messages are in each 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.
+
+HOME=$HOME rabbitmqctl list_queues -p $VHOST name messages_unacknowledged | \
+ grep -v "^Listing" | grep -v "done.$" | \
+ perl -nle'($q, $s) = split; $q =~ s/[.=-]/_/g; print("$q.value $s")'
View
75 plugins/rabbitmq/rabbitmq_messages_uncommitted
@@ -0,0 +1,75 @@
+#!/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.
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+HOME=/tmp/
+VHOST=${vhost:-"/"}
+QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \
+ grep -v '^Listing' | \
+ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' )
+
+if [ "$1" = "config" ]; then
+ QUEUE_WARN=${queue_warn:-10000}
+ QUEUE_CRIT=${queue_crit:-20000}
+
+ # The host name this plugin is for. (Can be overridden to have
+ # one machine answer for several)
+
+ # The title of the graph
+ echo "graph_title RabbitMQ $VHOST Uncommitted 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 uncommitted'
+ # 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 queue in $QUEUES; do
+ echo "$queue.label $queue"
+ echo "$queue.warning $QUEUE_WARN"
+ echo "$queue.critical $QUEUE_CRIT"
+ echo "$queue.info Uncommitted messages for $queue"
+ done
+
+ echo 'graph_info Lists how many messages are in each 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.
+
+HOME=$HOME rabbitmqctl list_channels -p $VHOST name messages_uncommitted | \
+ grep -v "^Listing" | grep -v "done.$" | \
+ perl -nle'($q, $s) = split; $q =~ s/[.=-]/_/g; print("$q.value $s")'
View
75 plugins/rabbitmq/rabbitmq_queue_memory
@@ -0,0 +1,75 @@
+#!/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.
+
+if [ "$1" = "autoconf" ]; then
+ echo yes
+ exit 0
+fi
+
+# If run with the "config"-parameter, give out information on how the
+# graphs should look.
+
+HOME=/tmp/
+VHOST=${vhost:-"/"}
+QUEUES=$(rabbitmqctl list_queues -p $VHOST name | \
+ grep -v '^Listing' | \
+ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' )
+
+if [ "$1" = "config" ]; then
+ QUEUE_WARN=${queue_warn:-10000}
+ QUEUE_CRIT=${queue_crit:-20000}
+
+ # The host name this plugin is for. (Can be overridden to have
+ # one machine answer for several)
+
+ # The title of the graph
+ echo "graph_title RabbitMQ $VHOST Memory used by 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 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'
+
+ for queue in $QUEUES; do
+ echo "$queue.label $queue"
+ echo "$queue.warning $QUEUE_WARN"
+ echo "$queue.critical $QUEUE_CRIT"
+ echo "$queue.info Memory used by $queue"
+ done
+
+ echo 'graph_info Show memory usage by 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.
+
+HOME=$HOME rabbitmqctl list_queues -p $VHOST name memory | \
+ grep -v "^Listing" | grep -v "done.$" | \
+ perl -nle'($q, $s) = split; $q =~ s/[.=-]/_/g; print("$q.value $s")'
Please sign in to comment.
Something went wrong with that request. Please try again.