Created
October 29, 2014 15:15
-
-
Save davidkeen/4038f6414d8b24b05234 to your computer and use it in GitHub Desktop.
Get queue size from jmx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyjolokia import Jolokia | |
import json | |
# Enter the jolokia url | |
j4p = Jolokia('http://localhost:8778/jolokia/') | |
# Put in the type, the mbean, or other options. Check the jolokia users guide for more info | |
# This then will return back a python dictionary of what happend to the request | |
data = j4p.request(type = 'read', mbean='org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=sms.in', attribute='QueueSize') | |
print json.dumps(data, indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment