Zabbix Documentation 3.4

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
manual:config:items:itemtypes:jmx_monitoring [2018/07/17 05:59]
martins-v custom endpoint example for JBoss EAP 6.4
manual:config:items:itemtypes:jmx_monitoring [2018/07/19 06:51] (current)
martins-v some rewording
Line 129: Line 129:
 === Custom endpoint example with JBoss EAP 6.4 === === Custom endpoint example with JBoss EAP 6.4 ===
  
-Custom endpoints ​(available since Zabbix 3.4) allow working with different transport protocols other than the default RMI.+Custom endpoints allow working with different transport protocols other than the default RMI.
  
 To illustrate this possibility,​ let's try to configure JBoss EAP 6.4 monitoring as an example. First, let's make some assumptions:​ To illustrate this possibility,​ let's try to configure JBoss EAP 6.4 monitoring as an example. First, let's make some assumptions:​
  
   * 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 144: Line 144:
   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 157: Line 157:
 {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example.png?​600|}} {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example.png?​600|}}
  
-If now we just take the standard %%"​%%Template App Generic Java JMX%%"​%% and link it to the host, then we probably will get an error: +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:
- +
-  $ tail -f /​tmp/​zabbix_java.log +
- +
-{{:​manual:​config:​items:​itemtypes:​jmx_jboss_example2.png?​600|}} +
- +
-Java gateway tells us that at the specified endpoint it is not RMI at all. Well, we already ​know that this version of JBoss uses the JBoss Remoting protocol instead of RMI, and we just need to start knocking at the right endpoint. +
- +
-Let's make a full clone of %%"​%%Template App Generic Java JMX%%"​%% and call it %%"​%%Template App Generic Java JMX-remoting%%"​%%. Let's select all the data elements inside this template and execute the mass update ​operation for the JMX endpoint parameter. Let's enter the following URL:+
  
   service:​jmx:​remoting-jmx://​{HOST.CONN}:​{HOST.PORT}   service:​jmx:​remoting-jmx://​{HOST.CONN}:​{HOST.PORT}
Line 174: Line 166:
   $ /​usr/​local/​sbin/​zabbix_server -R config_cache_reload   $ /​usr/​local/​sbin/​zabbix_server -R config_cache_reload
  
-Error again.+Note that you may encounter an error first.
  
 {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example4.png?​600|}} {{:​manual:​config:​items:​itemtypes:​jmx_jboss_example4.png?​600|}}
  
-What is it this time? +"​Unsupported protocol: remoting-jmx"​ means that Java gateway does not know how to work with the specified protocol. ​That can be fixed by creating ​a ~/​needed_modules.txt file with the following content:
- +
-"​Unsupported protocol: remoting-jmx"​ means that Java gateway does not know how to work with the specified protocol. ​Well, let's teach it. The advice from the article "​[[https://​www.denniskanbier.nl/​blog/​monitoring/​jboss-eap-6-monitoring-using-remoting-jmx-and-zabbix/​|JBoss EAP 6 monitoring using remoting-jmx and Zabbix]]"​ will help us in this. +
- +
-Create ​a ~/​needed_modules.txt file with the following content:+
  
   jboss-as-remoting   jboss-as-remoting
Line 198: Line 186:
   xnio-nio</​pre>​   xnio-nio</​pre>​
  
-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|}}