Zabbix Documentation 4.2

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

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 [2018/07/19 06:19]
martins-v some rewording
manual:config:items:itemtypes:jmx_monitoring [2018/10/01 09:42] (current)
Line 71: Line 71:
 The key in the screenshot below says ''​%%jmx["​java.lang:​type=Memory","​HeapMemoryUsage.used"​]%%''​. The key in the screenshot below says ''​%%jmx["​java.lang:​type=Memory","​HeapMemoryUsage.used"​]%%''​.
  
-{{jmx_item.png|}}+{{jmx_item.png?600|}}
  
 All mandatory input fields are marked with a red asterisk. ​ All mandatory input fields are marked with a red asterisk. ​
Line 127: Line 127:
   jmx[com.example:​type=Hello,​c:​\\documents]   jmx[com.example:​type=Hello,​c:​\\documents]
  
-For handling any other special characters in JMX item key, please see [[/​manual/​config/​items/​item/​key##​parameter_-_quoted_string|this section]].+For handling any other special characters in JMX item key, please see the item key format ​[[/​manual/​config/​items/​item/​key##​parameter_-_quoted_string|section]].
  
 This is actually all there is to it. Happy JMX monitoring! This is actually all there is to it. Happy JMX monitoring!
 +
 +== Non-primitive data types ==
 +
 +Since Zabbix 4.0.0 it is possible to work with custom MBeans returning non-primitive data types, which override the **toString()** method.
  
 === Custom endpoint example with JBoss EAP 6.4 === === Custom endpoint example with JBoss EAP 6.4 ===
Line 138: Line 142:
  
   * You have already installed Zabbix Java gateway. If not, then you can do it in accordance with the [[:​manual/​concepts/​java|documentation]].   * You have already installed Zabbix Java gateway. If not, then you can do it in accordance with the [[:​manual/​concepts/​java|documentation]].
-  * Zabbix server and Java gateway are installed with the prefix /usr/local/. +  * Zabbix server and Java gateway are installed with the prefix /​usr/​local/​ 
-  * JBoss is already installed in /​opt/​jboss-eap-6.4/​ and is running in standalone mode. +  * JBoss is already installed in /​opt/​jboss-eap-6.4/​ and is running in standalone mode 
-  * For simplicity of the experiment, we shall assume that all these components work on the same host. +  * We shall assume that all these components work on the same host 
-  * Firewall and SELinux are disabled (or configured accordingly, but this is beyond the scope of the article).+  * Firewall and SELinux are disabled (or configured accordingly)
  
 Let's make some simple settings in zabbix_server.conf:​ Let's make some simple settings in zabbix_server.conf:​
Line 148: Line 152:
   StartJavaPollers=5   StartJavaPollers=5
  
-And in the configuration file zabbix_java/​settings.sh (or zabbix_java_gateway.conf):​+And in the zabbix_java/​settings.sh ​configuration file (or zabbix_java_gateway.conf):​
  
   START_POLLERS=5   START_POLLERS=5
Line 161: Line 165:
 {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example.png?​600|}} {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example.png?​600|}}
  
-As we know that this version of JBoss uses the the JBoss Remoting protocol instead of RMI, we need to configure ​the JMX endpoint parameter accordingly:​+As we know that this version of JBoss uses the the JBoss Remoting protocol instead of RMI, we may mass update ​the JMX endpoint parameter ​in our JMX template ​accordingly:​
  
   service:​jmx:​remoting-jmx://​{HOST.CONN}:​{HOST.PORT}   service:​jmx:​remoting-jmx://​{HOST.CONN}:​{HOST.PORT}
Line 190: Line 194:
   xnio-nio</​pre>​   xnio-nio</​pre>​
  
-Then execute ​the command:+and then executing ​the command:
  
   $ for i in $(cat ~/​needed_modules.txt);​ do find /​opt/​jboss-eap-6.4 -iname ${i}*.jar -exec cp {} /​usr/​local/​sbin/​zabbix_java/​lib/​ \; ; done   $ for i in $(cat ~/​needed_modules.txt);​ do find /​opt/​jboss-eap-6.4 -iname ${i}*.jar -exec cp {} /​usr/​local/​sbin/​zabbix_java/​lib/​ \; ; done
  
-Thus, Java gateway will have all the necessary modules for working with jmx-remoting. What's left is to restart the Java gateway, wait a bit and if you did everything right, see that the precious ​data begin to arrive in Zabbix:+Thus, Java gateway will have all the necessary modules for working with jmx-remoting. What's left is to restart the Java gateway, wait a bit and if you did everything right, see that JMX monitoring ​data begin to arrive in Zabbix:
  
 {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example5.png?​600|}} {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example5.png?​600|}}