🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
JMX配置参考文档 [参考1][1] [参考2][2] ## Agent配置 ### 配置 Tomcat JMX ~~~ # vim /usr/local/tomcat/bin/catalina.sh CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=12345" ~~~ ~~~ # vim /usr/local/tomcat/conf/server.xml <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="12345" rmiServerPortPlatform="12346" /> ~~~ ### 重启tomcat ~~~ /usr/local/tomcat-7.0.65/bin/startup.sh ~~~ ### 命令行测试 ~~~ java -jar cmdline-jmxclient-0.10.3.jar - localhost:10053 java.lang:type=Memory NonHeapMemoryUsage ~~~ ## Server端 ### 编译时需要指定--enable-java ~~~ # ./configure --prefix=/usr/local/zabbix-3.0.5/ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --enable-java ~~~ ### 修改server端的参数和配置server端的web ### 修改JavaGateway的参数 ~~~ # vim /usr/local/zabbix-3.0.5/sbin/zabbix_java/settings.sh LISTEN_IP="0.0.0.0" #监听地址 LISTEN_PORT=10052 #监听端口 START_POLLERS=5 # 开启的工作线程数(必须大于等于后面zabbix_server.conf文件的StartJavaPollers参数) ~~~ ### 修改server端关于JavaGateway的参数 ~~~ # vim /usr/local/zabbix-3.0.5/etc/zabbix_server.conf JavaGateway=127.0.0.1 #Agent和server在同一主机,可以为127.0.0.1 JavaGatewayPort=10052 StartJavaPollers=5 ~~~ ### 启动zabbix_javagateway ~~~ # /usr/local/zabbix-3.0.5/sbin/zabbix_java/startup.sh ~~~ ## 监控模板 自带的tomcat模板不好用,[下载1][3],[下载2][4] ### 在zabbix调整参数,添加宏变量 ![](http://om4h63cja.bkt.clouddn.com/17-9-5/43393095.jpg) ~~~ Zabbix JMX Tomcat Extended Template configure Macros {$AJP_PORT} 默认8009 {$CONNECTOR_MODE} 默认BIO {$HTTPS_PORT} {$HTTP_PORT} 默认8080 ~~~ [1]:http://www.cnblogs.com/Eivll0m/p/5446311.html [2]:http://blog.chinaunix.net/uid-29179844-id-4093754.html [3]:https://github.com/rodrigoluissilva/Zabbix-JMX-Tomcat-Extended-Template/archive/88205a3d7a2bfd3e752ef3ef4fe68876666f087f.zip [4]:https://files.cnblogs.com/files/hiyang/zabbix_templates.zip