版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jeremy_yangt/article/details/49466319
— 书接上篇 —
Backup settings.sh
# cp /usr/local/zabbix2.4/sbin/zabbix_java/settings.sh{,.bak}
Edit /usr/local/zabbix2.4/sbin/zabbix_java/settings.sh
# grep -E -v '(#|^$)' settings.sh
LISTEN_IP="0.0.0.0"
LISTEN_PORT=10052
PID_FILE="/tmp/zabbix_java.pid"
START_POLLERS=5
Edit zabbix_server.conf
JavaGateway=127.0.0.1
JavaGatewayPort=10052
StartJavaPollers=5
Start javagateway
# /usr/local/zabbix2.4/sbin/zabbix_java/startup.sh
#netstat -anlp |grep 10052
tcp 0 0 ::ffff:127.0.0.1:10052 :::* LISTEN 9936/java
Config on tomacat
client:
download and install catalina-jmx-remote.jar
# wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.8/bin/extras/catalina-jmx-remote.jar
mv the jar
file to /usr/local/tomcat7/lib/
edit /usr/local/tomcat7/conf/server.xml
and add(at line: 35):
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="8090" rmiServerPortPlatform="8090" />
edit /usr/local/tomcat7/bin/catalina.sh
and add the follow lines:
export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=192.168.1.28"
- The
IP
(192.168.1.28) istomcat client's
ip address
Test
# java -jar cmdline-jmxclient-0.10.3.jar - 192.168.1.28:8090 java.lang:type=Memory
Restart tomcat service and zabbix_agentd
扫描二维码关注公众号,回复:
5594247 查看本文章
END