ZABBIX Forums  
  #1  
Old 29-11-2017, 07:24
joshuamcdo joshuamcdo is offline
Member
 
Join Date: Nov 2013
Posts: 73
Default JMX metrics.. Help!

Zabbix 3.2.4 (server)
Zabbix 3.0.13 (revision 74336) (agent)


I have been able to get the following information from JMX properly through a java gateway. All is good there..

jmx[java.lang:type=Threading,DaemonThreadCount]
jmx[java.lang:type=Threading,PeakThreadCount]
jmx[java.lang:type=Threading,ThreadCount]
jmx[java.lang:type=Memory,HeapMemoryUsage.used]


But when I try and get some AJP statistics. I simply cannot get them...

jmx[Standalone-user999:type=ThreadPool,currentThreadsBusy]
jmx[Standalone-user999:type=ThreadPool,name=ajp-nio-8999,currentThreadsBusy]
jmx[ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
jmx[Standalone-user999:name=ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
jmx[Standalone-user999:name=ajp-nio-8999,type=ThreadPool,currentThreadsBusy]
jmx[Standalone-user999\ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
jmx[Standalone-user999\\ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
jmx[Standalone-user999:type=ThreadPool,currentThreadsBusy,name=aj p-nio-8999]
jmx[*:type=ThreadPool,currentThreadsBusy,name=ajp-nio-8999]
jmx[.*:type=ThreadPool,currentThreadsBusy,name=ajp-nio.*]
jmx[Standalone\-user.*\|name=ajp\-nio\-.*\|type=ThreadPool:currentThreadsBusy]
jmx["Catalina:type=ThreadPool,name=\"ajp-nio-8999\"",currentThreadCount]
jmx["Catalina:type=ThreadPool,name=ajp-nio-8999",currentThreadCount]

Thoughts?

Thanks in advance.

J
Reply With Quote
  #2  
Old 30-11-2017, 16:39
joshuamcdo joshuamcdo is offline
Member
 
Join Date: Nov 2013
Posts: 73
Default (cough)

(sneeze)

Surely there is someone out there with JMX experience..
Reply With Quote
  #3  
Old 30-11-2017, 17:10
LenR LenR is offline
Senior Member
 
Join Date: Sep 2009
Posts: 357
Default

Yea, but when we got to the point where we got some JMX stats but not others, it was an issue on the Java end. In our case, the stats were for "something" that was HA and only active on one host at a time. That host would respond with the items and the others wouldn't. Of course, the items would stay unsupported for awhile after the "something" migrated to another host so stats were sluggish.

Since this wasn't by far the biggest problem the Java app owners had we didn't try to fix it.
Reply With Quote
  #4  
Old 30-11-2017, 17:17
joshuamcdo joshuamcdo is offline
Member
 
Join Date: Nov 2013
Posts: 73
Default

Quote:
Originally Posted by LenR View Post
Yea, but when we got to the point where we got some JMX stats but not others, it was an issue on the Java end.
Hmmm.. We had a tool that we demoed that displayed the JMX stats no problem.. I don't think it's an issue with the application. When I run the discovery command I can see what I am looking for in the discovery response... I think it's a matter or finding the right pattern for getting the information out but I also feel like I have tried everything...

Thanks,
J
Reply With Quote
  #5  
Old 05-12-2017, 16:25
rv_overseer rv_overseer is offline
Junior Member
 
Join Date: Jul 2014
Posts: 14
Default

I found this very useful:

https://www.zabbix.com/forum/showthread.php?t=36652

Download jmxterm on the host you are monitoring. Run the commands as described. I did the same and got the jmx keys I wanted
Reply With Quote
  #6  
Old 07-12-2017, 07:25
joshuamcdo joshuamcdo is offline
Member
 
Join Date: Nov 2013
Posts: 73
Default

That help me to understand how to find the beans in JMX. Now I having trouble constructing them into something zabbix can understand.

$>domain Standalone-user999
#domain is set to Standalone-user999
$>bean name="ajp-nio-8300",type=ThreadPool
#bean is set to Standalone-user9999:name="ajp-nio-8300",type=ThreadPool
$>get currentThreadsBusy
#mbean = Standalone-user999:name="ajp-nio-8300",type=ThreadPool:
currentThreadsBusy = 0;

I can't seem to get this translated to a key.


jmx["Standalone-user999:Type=ThreadPool,currentThreadsBusy"]

Help?




Quote:
Originally Posted by rv_overseer View Post
I found this very useful:

https://www.zabbix.com/forum/showthread.php?t=36652

Download jmxterm on the host you are monitoring. Run the commands as described. I did the same and got the jmx keys I wanted
Reply With Quote
  #7  
Old 07-12-2017, 09:40
rv_overseer rv_overseer is offline
Junior Member
 
Join Date: Jul 2014
Posts: 14
Default

$>domains
$>domain java.lang
#domain is set to java.lang
$>beans
$>bean java.lang:name=PS\ Eden\ Space,type=MemoryPool
#bean is set to java.lang:name=PS Eden Space,type=MemoryPool
$>info
#mbean = java.lang:name=PS Eden Space,type=MemoryPool
#class name = sun.management.MemoryPoolImpl
# attributes
%9 - Type (java.lang.String, r)
%10 - Usage (javax.management.openmbean.CompositeData, r)
%11 - UsageThreshold (long, rw)
$>get Usage

Usage UsageThreshold UsageThresholdCount UsageThresholdExceeded UsageThresholdSupported
$>get Usage
#mbean = java.lang:name=PS Eden Space,type=MemoryPool:
Usage = {
committed = 4004511744;
init = 1073741824;
max = 11074011136;
used = 3948406792;
};


So once you got these parts, then the jmx key is:
jmx["java.lang:type=MemoryPool,name=PS Eden Space",Usage.used]
Reply With Quote
  #8  
Old 07-12-2017, 09:46
rv_overseer rv_overseer is offline
Junior Member
 
Join Date: Jul 2014
Posts: 14
Default

Yours should be:

jmx["Standalone-user999:type=ThreadPool,name=ajp-nio-8300",currentThreadsBusy]

Last edited by rv_overseer; 07-12-2017 at 09:46. Reason: grammar
Reply With Quote
  #9  
Old 07-12-2017, 17:24
joshuamcdo joshuamcdo is offline
Member
 
Join Date: Nov 2013
Posts: 73
Default

Quote:
Originally Posted by rv_overseer View Post
Yours should be:

jmx["Standalone-user999:type=ThreadPool,name=ajp-nio-8300",currentThreadsBusy]
Yeah I have tried that one.. I get "Standalone-user999:type=ThreadPool,name=ajp-nio-8300" not supported.
Reply With Quote
  #10  
Old 08-12-2017, 05:27
joshuamcdo joshuamcdo is offline
Member
 
Join Date: Nov 2013
Posts: 73
Default

jmx["Standalone-user999:type=ThreadPool,name=\"ajp-nio-8300\"","currentThreadsBusy"]

The above worked.. Then others failed.. I realized after some time that anything with a - (dash) in it must have quotes and anything that doesn't must not.. (shrugs)

Thanks for the help.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:06.