开发者

Is it possible to get Free/Total/Max memory like Tomcat Manager tell with JMX?

With tomcat 5/6 and JMX enabled, it is possible to get how many free memory is available for monitoring propurses ?

I revised Template_Tomcat from zapcat template, but I didn't see any parameter which could be identified with free/total/max memory . There is parameters related with GC, and heap memory, but I'm really lost with this issue.

I didn't find any reply here or google, maybe I don't un开发者_JS百科derstand something which have to be obvious :(

Thank you very much !


I realize I am quite late to answer this, but I think you want to get the information from the MBean called Memory. See this section of Tomcat Monitoring FAQ.

In Zabbix template configuration, you set up items with these keys:

jmx[java.lang:type=Memory][HeapMemoryUsage].committed
jmx[java.lang:type=Memory][HeapMemoryUsage].used
jmx[java.lang:type=Memory][HeapMemoryUsage].max

If you use ZapCat deployed in Tomcat, you can see the list accessing the MBeans List page generated by ZapCat (something like: http://localhost:8180/zapcat-1.2/mbeans.jsp), it lists the available MBeans and attributes.

Note that if you were using JBoss instead, you could use these values (from the MBean named ServerInfo):

jmx[jboss.system:type=ServerInfo][MaxMemory]
jmx[jboss.system:type=ServerInfo][TotalMemory]
jmx[jboss.system:type=ServerInfo][FreeMemory]

At any rate though, you may want to install zabbix-agent in the machine being monitored, so you can monitor CPU, Memory and everything. You would have to set up another host in Zabbix, though.

Hope it helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜