Using jmxtrans-agent with tomcat

145 views
Skip to first unread message

Mohan Baruwal Chhetri

unread,
Mar 8, 2016, 11:48:23 PM3/8/16
to jmxtrans
Hi,

I'm using jmxtrans-agent with tomcat server and am trying to get the maxthreads, currentThreadCount, currentThreadsBusy, maxTime, processingTime, requestCount etc on the connector "http-nio-8080" only.

I can access the tomcat manager at localhost:8080/manager/status/all?XML=true and it shows the values as shown in the figure. 


I'd like to get this information using jxmtrans-agent. If I configure the jmxtrans-agent.xml file as follow I get the values for both connectors 'ajp-nio-8009' and 'http-nio-8080'. 


<!-- All global request processor attributes -->

<query objectName="Catalina:type=GlobalRequestProcessor,name=*" resultAlias="tomcat.#attribute#"/>


I want only the results corresponding to 'http-nio-8080 but when I use

<query objectName="Catalina:type=GlobalRequestProcessor,name=http-nio-8080" resultAlias="tomcat.#attribute#"/> 

I get  no output. I've tried 'http-nio-8080', 'http-8080' but am unable to get the measurement.


Can anybody help me fix this.


Cheers,

Mohan



Mohan Baruwal Chhetri

unread,
Mar 9, 2016, 6:07:55 PM3/9/16
to jmxtrans
I've found out the reason why it wasn't working. The correct way to specify the name is as follows:

<query objectName="Catalina:type=GlobalRequestProcessor,name=&quot;http-nio-8080&quot;" resultAlias="tomcat.#attribute#"/>

Cheers,
Mohan

Cyrille Le Clerc

unread,
Mar 9, 2016, 6:27:41 PM3/9/16
to jmxt...@googlegroups.com
Thanks for the good news Mohan, I was about to launch a Tomcat to findout the right syntax.

Cyrille

--
You received this message because you are subscribed to the Google Groups "jmxtrans" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jmxtrans+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Cyrille Le Clerc
email & gtalk : clec...@cloudbees.com / mob: +33-6.61.33.69.86 / skype: cyrille.leclerc
CloudBees, Inc
www.cloudbees.com



Mohan Baruwal Chhetri

unread,
Mar 9, 2016, 7:27:34 PM3/9/16
to jmxtrans
Hi Cyrille,

It might be a good idea to update the examples to show how to query for metrics related to HTTP or AJP connector rather than use the wildcard.
If we use the wild card, the metrics are written twice which can be confusing (see the examples of the ConsoleOutputWriter/FileOverwriterOutputWriter etc at https://github.com/cyrille-leclerc/jmxtrans-agent)

Cheers,
Mohan
Reply all
Reply to author
Forward
0 new messages