Zabbix -java-gateway installation and Tomcat monitoring.
Version:
Document version:1.1
Zabbix -java –gateway =3.4.6
OpenJDK version=1.8
JDK installation:
Lets install latest open JDK from the base repository.
#sudo yum install java-1.8.0-openjdk-devel
location of bin file : /usr/lib/jvm/java-openjdk/bin
Location of lib file: /usr/lib/jvm/java-openjdk/jre/lib
Zabbix -java-gateway installation
[Link] download RPM of Zabbix-java-gateway from the zabbix repository.
#wget [Link]
1.el7.x86_64.rpm
2. Install this rpm.
#rpm -ivh zabbix-java-gateway-3.4.6-1.el7.x86_64.rpm
3. We will get two conf. File in /etc/zabbix
zabbix_java_gateway.conf, zabbix_java_gateway_logback.xml
[Link] at zabbix_server.conf
Edit zabbix_server.conf
JavaGateway=[Link] //Javagateway is in same server of zabbix server or IP of java
Gateway server.
JavaGatewayPort=10052 //java gateway port (default)
StartJavaPollers=5 //Java Pollers.
[Link] check the status of zabbix-java-gateway
# systemctl status zabbix-java-gateway
[Link] restart zabbix-java-gateway.
#service zabbix-java-gateway restart
[Link] can check log of zabbix-java-gateway or below process
#netstat -anlp |grep 10052
[Link] can also check zabbix-java-gateway log in below location.
#tail –f /var/log/zabbix/zabbix_java_gateway.log
As We want to Monitor tomcat, We need enable jmx monitoring of tomcat.
So lets do it.
[Link] and install [Link]
# wget [Link]
[Link]
2. Mv the jar file to /usr/local/jakarta-tomcat-7.0.61/lib/
3. Edit /usr/local/jakarta-tomcat-7.0.61/conf/[Link] and add(at line: 35):Just put
where you find like <Listener> in [Link]
<Listener className="[Link]"
rmiRegistryPortPlatform="8090" rmiServerPortPlatform="8090" />
[Link] /usr/local/tomcat7/bin/[Link] and add (anywhere) the follow lines:
export CATALINA_OPTS="-[Link] -
[Link]=false -
[Link]=false -[Link]=[Link] -
[Link]=12345"
N.B: IP will be same server ip where Catalina is running. Mention port as per wish.
[Link] Restart the tomcat and check log/[Link] where you will find jmxproxy has
been started with the mention port.
That’s all in server side 😃.
Web panal configuration:
[Link] host just like you add.
[Link] the configured host ip and port that you have added in [Link].
[Link] click on add and its done.
Now check JMX is green or [Link] you get just like below parameter then its done.
How can check JMX data?
We can check JMX data in 3 way.
[Link].
2.[Link] //need to configure first.
[Link] client.
Jconsole Procedure.
[Link] check using JConsole,Just install jdk in your computer(not in vm/server).
[Link] go to C:\Program Files\Java\jdk1.8.0_111\bin
3. Here you will get jconsole application.
[Link] will get a window just like below pic.
[Link] put the IP and port that you have configured in [Link] and click on connect.
You will get you desired data with beautiful graph 😄.
Now [Link] configuration.
You just edit /usr/local/jakarta-tomcat-7.0.61/conf/[Link] and add the
[Link] be informed that you have to use mentioned username and password.
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<role rolename="manager-jmx"/>
<role rolename="manager-script"/>
<user username="tomcat" password="tomcat" roles="admin-gui,manager-
gui,manager-jmx"/>
Now restart tomcat and paste the url into the [Link] the username and
password you will get jmx data.
Now JMXterm client.
1. Download [Link] from the below link.
[Link]
[Link]/download
2. Now run the jar using below command.
#java -jar [Link]
3. Now you follow the below command
$>open [Link]:12345
#Connection to [Link]:12345 is opened
$>domains
#following domains are available
Catalina
JMImplementation
Users
[Link]
[Link]
[Link]
[Link]
$>domain Catalina
#domain is set to Catalina
$>beans
#domain = Catalina:
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,j2eeTy
pe=Filter,name=Tomcat WebSocket (JSR356) Filter
$>bean Catalina:context=/host-manager,host=localhost,type=Manager
#bean is set to Catalina:context=/host-manager,host=localhost,type=Manager
$>info
#mbean = Catalina:context=/host-manager,host=localhost,type=Manager
#class name = [Link]
# attributes
%0 - activeSessions (int, r)
%1 - className ([Link], r)
%2 - distributable (boolean, rw)
%3 - duplicates (int, rw)
$>get activeSessions
#mbean = Catalina:context=/host-manager,host=localhost,type=Manager:
activeSessions = 0;