Zabbix Server is a strong network monitoring tools. Now I have to show how to check apache tomcat service from Zabbix Server. Apache is an open source http web server with java.
★ Install Zabbix server on ubuntu 16.04
★ Send Mail Notification From Zabbix Server Using Gmail
Zabbix Server For Setup Apache Tomcat
Zabbix Server IP : 20.55.10.1
Client Machine IP : 20.55.10.2
Zabbix Gateway Address : 20.55.10.1 [Zabbix Server IP]
Step #01: Goto Zabbix Server config file then insert Java gateway, Java gateway port and StartJavaPollers option.
root@Zabbix-Server~:# vi /etc/zabbix/zabbix_server.conf
Insert anywhere into conf file.
JavaGateway=20.55.10.1 JavaGatewayPort=10052 StartJavaPollers=5
Then save and restart your Zabbix server.
Step #02: Install Zabbix Java Gateway via apt-get
root@Zabbix-Server~:# apt-get install zabbix-java-gateway
When installation process completed then restart your Zabbix Java Gateway
root@Zabbix-Server~:# service zabbix-java-gateway restart
Client machine and edit catalina.sh
( Optional )
If you can’t install Java and Tomcat service Into your Linux machine.
Step #03: Open your client machine then goto Tomcat folder then find bin folder now open catalina.sh file for setup Java and Tomcat remote allow.
root@ubuntu~:# vi /home/local/apps/tomcat/8.0.46/bin/catalina.sh
Then setup CATALINA_OPTS config into catalina.sh file.
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=20.55.10.2"
Now stop and start your tomcat service.
Zabbix Web Config Details Insert JMX interface And Template App Generic Java JMX
( Optional )
How to Install And Configure Zabbix Agent on Ubuntu
Step #04: Click your ubuntu machine add JMX interface and add your machine IP address. Now goto Template tab insert Template App Generic Java JMX. Then update your machine click Add button on bottom side.
See image step by step setup JMX interface and HeapMemory item add.
Step #06: Create HeapMemory item. Goto Host then click Item. Click Create item on the right corner.
Name : HeapMemory
Type : JMX agent
Key : jmx[“java.lang:type=Memory”,”HeapMemoryUsage.used”]
Host interface : 20.55.10.1:12345
JMX endpoint : service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi
User Name : {$JMX_USERNMAE}
Password : {$JMX_PASSWORD}
See HeapMemory Item example image below:
Step #07: See latest data goto Monitoring / Latest data and find you machine name click Apply button.
Mail Notification Setup When Tomcat Stop or Start
Send Mail Notification From Zabbix Server Using Gmail
Step #08: Create trigger for get mail notification when Tomcat stop or start.
Goto your machine Trigger option then search java uptime click top right corner Create trigger button.
Enter any name here is known your Java up and down.
Name : Any name here Severity : High Expression : {ubuntu:jmx["java.lang:type=Runtime",Uptime].nodata(1m)}=1
Details
Name = any name here
Severity = High is this when severity high then report to Zabbix Administrator and send mail.
Expression = First machine name ubuntu, jmx code, minimum time to send report. If you can change 5m or 10m then Update your trigger.
Step #09: Create Action for created trigger. Goto Configuration / Actions
New condition select Trigger then search created trigger. Then click Add button and Update your actions.
Step #10: Now check trigger status goto Monitoring / Triggers then select Severity click Apply.
Also see another post
How To Install Zabbix Server 3.4.4 Into Ubuntu 17.04
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
Leave a Comment