Skip to content

Instantly share code, notes, and snippets.

@alq666
Created October 26, 2012 20:05
Show Gist options
  • Save alq666/3961144 to your computer and use it in GitHub Desktop.
Save alq666/3961144 to your computer and use it in GitHub Desktop.
diff --git a/checks/jmx.py b/checks/jmx.py
--- a/checks/jmx.py
+++ b/checks/jmx.py
@@ -474,7 +474,11 @@ class Solr(Jvm):
return self.get_metrics()
-def testprofiling():
+def test_tomcat():
import logging
+ from pprint import pprint as pp
tomcat = Tomcat(logging)
- print tomcat.check({'tomcat_jmx_instance_1': 'localhost:8090:moncat'})
+ pp(tomcat.check({'tomcat_jmx_instance_1': 'localhost:8090:tacmot'}))
+
+if __name__ == "__main__":
+ test_tomcat()
@alq666
Copy link
Author

alq666 commented Oct 26, 2012

If you apply this patch to /usr/share/datadog/agent/checks/jmx.py and then run:

cd /usr/share/datadog/agent
PYTHONPATH=$PWD python checks/jmx.py

you should get something a list of metrics collected. If your JMX port is not 8090, feel free to update the port in the test_tomcat() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment