mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Merge pull request #218 from jimmyjones2/master
Add plugins for Apache Qpid
This commit is contained in:
commit
9eb29b306d
5 changed files with 240 additions and 0 deletions
48
plugins/qpid/qpid_bytedepth
Executable file
48
plugins/qpid/qpid_bytedepth
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Plugin to monitor Apache Qpid
|
||||
# - graphs the number of outstanding bytes on queue(s) specified in config
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# queues (required) - space separated list of queues to display (regex allowed)
|
||||
#
|
||||
# Made by Jimmy Jones (jimmyjones2 AT gmx DOT co DOT uk)
|
||||
#
|
||||
# Licence: GPLv2
|
||||
#
|
||||
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from qmf.console import Session
|
||||
|
||||
if not "queues" in os.environ:
|
||||
print >> sys.stderr, "Missing env.queues in config"
|
||||
sys.exit(-1)
|
||||
|
||||
output_queue = []
|
||||
sess = Session()
|
||||
broker = sess.addBroker()
|
||||
queues = sess.getObjects(_class="queue", _package="org.apache.qpid.broker")
|
||||
for q in queues:
|
||||
for match in os.environ["queues"].split(" "):
|
||||
if re.match(match, q.name):
|
||||
output_queue.append(re.sub('[^a-zA-Z0-9_]', '_', q.name))
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
print "graph_category Qpid";
|
||||
print "graph_title Queue byte depth";
|
||||
print "graph_vlabel bytes"
|
||||
for queue in output_queue:
|
||||
print "%s.label %s" % (queue, queue)
|
||||
print "%s.min 0" % queue
|
||||
print "%s.type GAUGE" % queue
|
||||
else:
|
||||
for q in queues:
|
||||
qname = re.sub('[^a-zA-Z0-9_]', '_', q.name)
|
||||
if qname in output_queue:
|
||||
print "%s.value %u" % (qname, q.byteDepth)
|
||||
|
||||
sess.delBroker(broker)
|
||||
|
48
plugins/qpid/qpid_discardsring
Executable file
48
plugins/qpid/qpid_discardsring
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Plugin to monitor Apache Qpid
|
||||
# - graphs the number of messages discarded from queue(s) specified in config
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# queues (required) - space separated list of queues to display (regex allowed)
|
||||
#
|
||||
# Made by Jimmy Jones (jimmyjones2 AT gmx DOT co DOT uk)
|
||||
#
|
||||
# Licence: GPLv2
|
||||
#
|
||||
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from qmf.console import Session
|
||||
|
||||
if not "queues" in os.environ:
|
||||
print >> sys.stderr, "Missing env.queues in config"
|
||||
sys.exit(-1)
|
||||
|
||||
output_queue = []
|
||||
sess = Session()
|
||||
broker = sess.addBroker()
|
||||
queues = sess.getObjects(_class="queue", _package="org.apache.qpid.broker")
|
||||
for q in queues:
|
||||
for match in os.environ["queues"].split(" "):
|
||||
if re.match(match, q.name):
|
||||
output_queue.append(re.sub('[^a-zA-Z0-9_]', '_', q.name))
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
print "graph_category Qpid";
|
||||
print "graph_title Ring queue discard rate";
|
||||
print "graph_vlabel messages/second";
|
||||
for queue in output_queue:
|
||||
print "%s.label %s" % (queue, queue)
|
||||
print "%s.min 0" % queue
|
||||
print "%s.type COUNTER" % queue
|
||||
else:
|
||||
for q in queues:
|
||||
qname = re.sub('[^a-zA-Z0-9_]', '_', q.name)
|
||||
if qname in output_queue:
|
||||
print "%s.value %u" % (qname, q.discardsRing)
|
||||
|
||||
sess.delBroker(broker)
|
||||
|
48
plugins/qpid/qpid_enqueuebytes
Executable file
48
plugins/qpid/qpid_enqueuebytes
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Plugin to monitor Apache Qpid
|
||||
# - graph ingest rate (bytes/sec) of queue(s) specified in config
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# queues (required) - space separated list of queues to display (regex allowed)
|
||||
#
|
||||
# Made by Jimmy Jones (jimmyjones2 AT gmx DOT co DOT uk)
|
||||
#
|
||||
# Licence: GPLv2
|
||||
#
|
||||
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from qmf.console import Session
|
||||
|
||||
if not "queues" in os.environ:
|
||||
print >> sys.stderr, "Missing env.queues in config"
|
||||
sys.exit(-1)
|
||||
|
||||
output_queue = []
|
||||
sess = Session()
|
||||
broker = sess.addBroker()
|
||||
queues = sess.getObjects(_class="queue", _package="org.apache.qpid.broker")
|
||||
for q in queues:
|
||||
for match in os.environ["queues"].split(" "):
|
||||
if re.match(match, q.name):
|
||||
output_queue.append(re.sub('[^a-zA-Z0-9_]', '_', q.name))
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
print "graph_category Qpid";
|
||||
print "graph_title Enqueue data rate";
|
||||
print "graph_vlabel bytes/second"
|
||||
for queue in output_queue:
|
||||
print "%s.label %s" % (queue, queue)
|
||||
print "%s.min 0" % queue
|
||||
print "%s.type COUNTER" % queue
|
||||
else:
|
||||
for q in queues:
|
||||
qname = re.sub('[^a-zA-Z0-9_]', '_', q.name)
|
||||
if qname in output_queue:
|
||||
print "%s.value %u" % (qname, q.byteTotalEnqueues)
|
||||
|
||||
sess.delBroker(broker)
|
||||
|
48
plugins/qpid/qpid_enqueuecount
Executable file
48
plugins/qpid/qpid_enqueuecount
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Plugin to monitor Apache Qpid
|
||||
# - graphs ingest rate (messages/sec) of queue(s) specified in config
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# queues (required) - space separated list of queues to display (regex allowed)
|
||||
#
|
||||
# Made by Jimmy Jones (jimmyjones2 AT gmx DOT co DOT uk)
|
||||
#
|
||||
# Licence: GPLv2
|
||||
#
|
||||
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from qmf.console import Session
|
||||
|
||||
if not "queues" in os.environ:
|
||||
print >> sys.stderr, "Missing env.queues in config"
|
||||
sys.exit(-1)
|
||||
|
||||
output_queue = []
|
||||
sess = Session()
|
||||
broker = sess.addBroker()
|
||||
queues = sess.getObjects(_class="queue", _package="org.apache.qpid.broker")
|
||||
for q in queues:
|
||||
for match in os.environ["queues"].split(" "):
|
||||
if re.match(match, q.name):
|
||||
output_queue.append(re.sub('[^a-zA-Z0-9_]', '_', q.name))
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
print "graph_category Qpid";
|
||||
print "graph_title Enqueue message rate";
|
||||
print "graph_vlabel messages/second"
|
||||
for queue in output_queue:
|
||||
print "%s.label %s" % (queue, queue)
|
||||
print "%s.min 0" % queue
|
||||
print "%s.type COUNTER" % queue
|
||||
else:
|
||||
for q in queues:
|
||||
qname = re.sub('[^a-zA-Z0-9_]', '_', q.name)
|
||||
if qname in output_queue:
|
||||
print "%s.value %u" % (qname, q.msgTotalEnqueues)
|
||||
|
||||
sess.delBroker(broker)
|
||||
|
48
plugins/qpid/qpid_msgdepth
Executable file
48
plugins/qpid/qpid_msgdepth
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Plugin to monitor Apache Qpid
|
||||
# - graphs the number of outstanding messages on queue(s) specified in config
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# queues (required) - space separated list of queues to display (regex allowed)
|
||||
#
|
||||
# Made by Jimmy Jones (jimmyjones2 AT gmx DOT co DOT uk)
|
||||
#
|
||||
# Licence: GPLv2
|
||||
#
|
||||
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from qmf.console import Session
|
||||
|
||||
if not "queues" in os.environ:
|
||||
print >> sys.stderr, "Missing env.queues in config"
|
||||
sys.exit(-1)
|
||||
|
||||
output_queue = []
|
||||
sess = Session()
|
||||
broker = sess.addBroker()
|
||||
queues = sess.getObjects(_class="queue", _package="org.apache.qpid.broker")
|
||||
for q in queues:
|
||||
for match in os.environ["queues"].split(" "):
|
||||
if re.match(match, q.name):
|
||||
output_queue.append(re.sub('[^a-zA-Z0-9_]', '_', q.name))
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
print "graph_category Qpid";
|
||||
print "graph_title Queue message depth";
|
||||
print "graph_vlabel messages"
|
||||
for queue in output_queue:
|
||||
print "%s.label %s" % (queue, queue)
|
||||
print "%s.min 0" % queue
|
||||
print "%s.type GAUGE" % queue
|
||||
else:
|
||||
for q in queues:
|
||||
qname = re.sub('[^a-zA-Z0-9_]', '_', q.name)
|
||||
if qname in output_queue:
|
||||
print "%s.value %u" % (qname, q.msgDepth)
|
||||
|
||||
sess.delBroker(broker)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue