Zabbix Documentation 3.4 development:4.0Unsupported versions:

User Tools

Site Tools



5 Discovery of JMX objects


It is possible to discover all JMX MBeans or MBean attributes or to specify a pattern for the discovery of these objects.

Item key

In discovery rule configuration, select JMX agent in the Type field.

The item key to use is

jmx.discovery[<discovery mode>,<object name>]


  • discovery mode - one of the following: attributes (retrieve JMX MBean attributes, default) or beans (retrieve JMX MBeans)
  • object name - object name pattern identifying the MBean names to be retrieved (empty by default, retrieving all registered beans).

You may consult ObjectName documentation for the options of specifying object name pattern.

If no parameters are passed, all MBean attributes from JMX are requested.

Not specifying parameters for JMX discovery or trying to receive all attributes for a wide range like *:type=*,name=* may lead to potential performance problems.

This item key is supported since Zabbix Java gateway 3.4.

Item key examples:

jmx.discovery  #Retrieve all JMX MBean attributes
jmx.discovery[beans]  #Retrieve all JMX MBeans
jmx.discovery[attributes,"*:type=GarbageCollector,name=*"]  #Retrieve all garbage collector attributes
jmx.discovery[beans,"*:type=GarbageCollector,name=*"]  #Retrieve all garbage collectors

This item returns a JSON object. For example, in the discovery of MBean attributes (reformatted for clarity):

         "{#JMXOBJ}":"java.lang:type=GarbageCollector,name=PS Scavenge",
         "{#JMXDESC}":"java.lang:type=GarbageCollector,name=PS Scavenge,CollectionCount",
         "{#JMXOBJ}":"java.lang:type=GarbageCollector,name=PS Scavenge",
         "{#JMXDESC}":"java.lang:type=GarbageCollector,name=PS Scavenge,CollectionTime",
         "{#JMXOBJ}":"java.lang:type=GarbageCollector,name=PS Scavenge",
         "{#JMXDESC}":"java.lang:type=GarbageCollector,name=PS Scavenge,Valid",
         "{#JMXVALUE}":"PS Scavenge",
         "{#JMXOBJ}":"java.lang:type=GarbageCollector,name=PS Scavenge",
         "{#JMXDESC}":"java.lang:type=GarbageCollector,name=PS Scavenge,Name",
         "{#JMXVALUE}":"java.lang:type=GarbageCollector,name=PS Scavenge",
         "{#JMXOBJ}":"java.lang:type=GarbageCollector,name=PS Scavenge",
         "{#JMXDESC}":"java.lang:type=GarbageCollector,name=PS Scavenge,ObjectName",

In the discovery of MBeans (reformatted for clarity):

         "{#JMXOBJ}":"java.lang:type=GarbageCollector,name=PS Scavenge",
         "{#JMXNAME}":"PS Scavenge"

Supported macros

The following macros are supported for use in the discovery rule filter and prototypes of items, triggers and graphs:

Discovery of MBean attributes
{#JMXVALUE} Attribute value.
{#JMXTYPE} Attribute type.
{#JMXOBJ} Object name.
{#JMXDESC} Object name including attribute name.
{#JMXATTR} Attribute name.
Discovery of MBeans
{#JMXDOMAIN} MBean domain. (Zabbix reserved name)
{#JMXOBJ} Object name. (Zabbix reserved name)
{#JMX<key property>} MBean properties (like {#JMXTYPE}, {#JMXNAME}). Some important notes to pay attention to when defining MBean attribute name that is created from MBean property name by the following algorithm:

* attribute name case is changed to uppercase;
* attribute name case is ignored (no LLD macro is generated) in case it consists of not supported characters. Supported characters can be described by the following regular expression: “A-Z0-9_\.”;
* if an attribute name is called “obj” or “domain” it will be replaced with the values of Zabbix properties {#JMXOBJ} and {#JMXDOMAIN} (supported since Zabbix 3.4.3.).

Please consider this jmx.discovery (with “beans” mode) example. MBean has the following properties defined:

attributes []=1,2,3

As a result of JMX discovery, the following LLD macros will be generated:

  • {#JMXDOMAIN} - Zabbix internal, describing the domain of MBean
  • {#JMXOBJ} - Zabbix internal, describing MBean object
  • {#JMXNAME} - created from “name” property

Ignored properties are:

  • тип : its name contains unsupported characters (non-ASCII)
  • attributes[] : its name contains unsupported characters (square brackets are not supported)
  • Name : it's already defined (name=test)
  • domAin : it's a Zabbix reserved name