Zabbix Documentation 2.0

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


manual:config:items:itemtypes:jmx_monitoring

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:config:items:itemtypes:jmx_monitoring [2012/09/20 09:45]
martins-v updated screenshot
manual:config:items:itemtypes:jmx_monitoring [2015/11/19 06:29] (current)
martins-v clarifying that local host only allowed to connect
Line 11: Line 11:
 When Zabbix server wants to know the value of a particular JMX counter on a host, it asks the Zabbix **Java gateway**, which in turn uses the [[http://​java.sun.com/​javase/​technologies/​core/​mntr-mgmt/​javamanagement/​|JMX management API]] to query the application of interest remotely. When Zabbix server wants to know the value of a particular JMX counter on a host, it asks the Zabbix **Java gateway**, which in turn uses the [[http://​java.sun.com/​javase/​technologies/​core/​mntr-mgmt/​javamanagement/​|JMX management API]] to query the application of interest remotely.
  
-<​note>​For more details on Zabbix Java gateway, including where to get it and how to set it up see [[2.0:manual:​concepts:​java | this section]] of the manual.</​note>​+<​note>​For more details on Zabbix Java gateway, including where to get it and how to set it up see [[manual:​concepts:​java| this section]] of the manual.</​note>​
  
 === - Enabling remote JMX monitoring for Java application === === - Enabling remote JMX monitoring for Java application ===
Line 26: Line 26:
   -jar /​usr/​share/​doc/​openjdk-6-jre-headless/​demo/​jfc/​Notepad/​Notepad.jar   -jar /​usr/​share/​doc/​openjdk-6-jre-headless/​demo/​jfc/​Notepad/​Notepad.jar
  
-This makes Java listen for incoming JMX connections on port 12345 and tells it not to require authentication or SSL.+This makes Java listen for incoming JMX connections on port 12345, from local host only, and tells it not to require authentication or SSL.  
 + 
 +If you want to allow connections on another interface, set the -Djava.rmi.server.hostname parameter to the IP of that interface.
  
 If you wish to be more stringent about security, there are many other Java options available to you. For instance, the next example starts the application with a more versatile set of options and opens it to a wider network, not just local host. If you wish to be more stringent about security, there are many other Java options available to you. For instance, the next example starts the application with a more versatile set of options and opens it to a wider network, not just local host.
Line 59: Line 61:
 You begin by creating a JMX-type interface on the host of interest: You begin by creating a JMX-type interface on the host of interest:
  
-{{:​2.0:​manual:​config:​items:​itemtypes:​jmx_interface.png?​600|}}+{{jmx_interface.png?​600|}}
  
 == Adding JMX agent item == == Adding JMX agent item ==
Line 65: Line 67:
 For each JMX counter you are interested in you add an item of type **JMX agent** attached to that interface. If you have configured authentication on your Java application,​ then you also specify username and password. ​ For each JMX counter you are interested in you add an item of type **JMX agent** attached to that interface. If you have configured authentication on your Java application,​ then you also specify username and password. ​
  
-The key is not seen fully in the screenshot below, but it says ''​%%jmx["​java.lang:​type=Memory","​HeapMemoryUsage.used"​]%%''​. The JMX item key syntax is similar to Zapcat items, except that a comma is used for separating arguments instead of "​]["​. The key consists of 2 parameters:+The key in the screenshot below says ''​%%jmx["​java.lang:​type=Memory","​HeapMemoryUsage.used"​]%%''​. The JMX item key syntax is similar to Zapcat items, except that a comma is used for separating arguments instead of "​]["​. The key consists of 2 parameters:
  
   * object name - which represents the object name of an MBean   * object name - which represents the object name of an MBean
   * attribute name - an MBean attribute name with optional composite data field names separated by dots   * attribute name - an MBean attribute name with optional composite data field names separated by dots
  
-See below for examples of JMX item keys.+See below for more detail on JMX item keys.
  
-{{:​2.0:​manual:​config-item-small.png|}}+{{jmx_item.png?550|}}
  
 If you wish to monitor a Boolean counter that is either "​true"​ or "​false",​ then you specify type of information as "​Numeric (unsigned)"​ and data type as "​Boolean"​. Server will store Boolean values as 1 or 0, respectively. If you wish to monitor a Boolean counter that is either "​true"​ or "​false",​ then you specify type of information as "​Numeric (unsigned)"​ and data type as "​Boolean"​. Server will store Boolean values as 1 or 0, respectively.
- 
 == JMX item keys in more detail == == JMX item keys in more detail ==
  
Line 120: Line 121:
 If the object name or attribute name contains spaces or commas double-quote it: If the object name or attribute name contains spaces or commas double-quote it:
  
-  jmx["java.lang:name=ConcurrentMarkSweep,​type=GarbageCollector","​LastGcInfo.memoryUsageAfterGc.CMS Old Gen.committed"]+  jmx["com.example:Type=Hello","​fruits.apple.total weight"]
  
 This is actually all there is to it. Happy JMX monitoring! This is actually all there is to it. Happy JMX monitoring!