You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Zabbix 3.0 still unable to monitor JBOSS jmx out of the box. some source hacking and recompilation needed.

What to read

http://www.denniskanbier.nl/blog/monitoring/jboss-eap-6-monitoring-using-remoting-jmx-and-zabbix/

 

Prepare Zabbix

Install gateway

yum install zabbix-java-gateway

Hack Zabbix source

mkdir /usr/share/zabbix-java-gateway/tmp
cd /usr/share/zabbix-java-gateway/tmp
wget "http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.1/zabbix-3.0.1.tar.gz"
tar -xvf zabbix-3.0.1.tar.gz
yum groupinstall "Development Tools"
yum -y install mysql-server httpd php mysql-devel php-mysql libxml2-devel libcurl-devel php-mbstring php-bcmath php-gd php-xml
vi src/zabbix_java/src/com/zabbix/gateway/JMXItemChecker.java
./configure --enable-server --enable-agent --with-mysql --with-libcurl --with-libxml2 --enable-java
make
mv /usr/share/zabbix-java-gateway/bin/zabbix-java-gateway-3.0.1.jar /usr/share/zabbix-java-gateway/bin/zabbix-java-gateway-3.0.1.jar.old
cp src/zabbix_java/bin/zabbix-java-gateway-3.0.1.jar /usr/share/zabbix-java-gateway/bin/zabbix-java-gateway-3.0.1.jar
service zabbix-java-gateway restart
tail -f  /var/log/zabbix/zabbix_java_gateway.log

the code hack

src/zabbix_java/src/com/zabbix/gateway/JMXItemChecker.java fragment
 //Dirty solution for ZBXNEXT-1274
Integer remoting = new Integer("4447");
int retval = remoting.compareTo(port);
if (retval == 0)
{
        url = new JMXServiceURL("service:jmx:remoting-jmx://" + conn + ":" + port);
}
else
{
        url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + conn + ":" + port + "/jmxrmi");
}

Add JBOSS modules to Zabbix Java Gateway

# take this file from your JBOSS instalation or download
# scp jboss@jboss-server.example.com:/usr/share/jboss-eap-6.2/bin/client/jboss-cli-client.jar /usr/share/zabbix-java-gateway/lib
wget http://central.maven.org/maven2/org/jboss/as/jboss-as-cli/7.2.0.Final/jboss-as-cli-7.2.0.Final-client.jar -O /usr/share/zabbix-java-gateway/lib/jboss-cli-client.jar

Configure java gateway

vi /etc/zabbix/zabbix_java_gateway.conf
service zabbix-server restart

config

JavaGateway=zabbix-server.example.com
JavaGatewayPort=10052
StartJavaPollers=5

Configure hosts in Zabbix

JMX Interfaces may be added to existing host monitored with zabbix agent or new host for JMX monitoring only may be created

 

Configuration -> Hosts -> jboss-server.example.com -> Host -> JMX Interfaces -> Add

Configuration -> Hosts -> jboss-server.example.com -> Templates -> Link new templates -> Template JMX Generic -> Add -> Add

 

  • No labels