分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
1.zabbix 服务端安装,监控jmx 需要--enable-javazabbix 客户端不需要 --enable-java2.zabbix_server端安装jdk安装jdk[root@nginx tmp]# tar xf jdk-7u9-linux-x64.tar.gz -C /usr/local/[root@nginx tmp]# ls /usr/local/jdk1.7.0_09/bin jre README.html THIRDPARTYLICENSEREADME.txtCOPYRIGHT lib releasedb LICENSE src.zipinclude man THIRDPARTYLICENSEREADME-JAVAFX.txt3.修改zabbix_java相关选项然后进入到下面的目录下面进行seeting.sh脚本编辑zabbix:/usr/local/sbin/zabbix_java# pwd/usr/local/sbin/zabbix_javazabbix:/usr/local/sbin/zabbix_java# chmod +x settings.sh zabbix:/usr/local/sbin/zabbix_java# lsbin lib settings.sh shutdown.sh startup.shLISTEN_IP="0.0.0.0"LISTEN_PORT=10052PID_FILE="/tmp/zabbix_java.pid"START_POLLERS=5zabbix:/usr/local/sbin/zabbix_java# ./startup.sh -------------------5zabbix:/usr/local/sbin/zabbix_java# cat startup.sh #!/bin/bashcd $(dirname $0)source settings.shecho "-------------------"echo $START_POLLERS 其中 LISTEN_PORT 和 LISTEN_IP 可以不配置,zabbix_java 会采用默认值。但是 PID_FILE 和 START_POLLERS 必须配置,尤其主意 START_POLLERS,若不配置 zabbix_java 依旧可以启动但是是不工作的。[root@nginx zabbix_java]#4.修改配置选项:在zabbix服务端上配置/etc/zabbix/zabbix_server.conf添加:JavaGateway=127.0.0.1 ##这个地址是服务端的地址JavaGatewayPort=10052StartJavaPollers=5zabbix:/usr/local/sbin/zabbix_java# netstat -nap | grep 10052tcp 0 0 127.0.0.1:54229 127.0.0.1:10052 TIME_WAIT - tcp 0 0 127.0.0.1:53891 127.0.0.1:10052 TIME_WAIT - tcp 0 0 :::10052 :::* LISTEN 15763/java tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:54499 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:54149 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:54128 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:53930 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:54207 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:53610 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:53641 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:53590 TIME_WAIT - tcp 0 0 ::ffff:127.0.0.1:10052 ::ffff:127.0.0.1:54184 TIME_WAIT - zabbix:/usr/local/sbin/zabbix_java# ps -ef | grep 15763root 15763 1 3 09:38 pts/0 00:00:01 java -server -classpath lib:lib/logback-classic-0.9.27.jar:lib/logback-core-0.9.27.jar:lib/org-json-2010-12-28.jar:lib/slf4j-api-1.6.1.jar:bin/zabbix-java-gateway-2.2.2.jar -Dzabbix.pidFile=/tmp/zabbix_java.pid -Dzabbix.listenIP=0.0.0.0 -Dzabbix.listenPort=10052 -Dzabbix.startPollers=5 com.zabbix.gateway.JavaGatewayroot 15804 14315 0 09:39 pts/0 00:00:00 grep 157635.启动zabbix_java找到zabbix_java目录路径,然后执行命令./startup.sh[root@nginx zabbix-2.2.0]# find / -name zabbix_java/usr/local/sbin/zabbix_javatomcat 端配置:6.调整tomcat端,安装catalina-jmx-remote.jarwget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.8/bin/extras/catalina-jmx-remote.jar[tomcat@wx01 lib]$ mv /home/tomcat/catalina-jmx-remote.jar .[tomcat@wx01 lib]$ ls -ltr catalina-jmx-remote.jar-rw-rw-r-- 1 tomcat tomcat 9533 Feb 5 2011 catalina-jmx-remote.jar7.修改catalina.sh文件修改catalina.sh文件,添加# -----------------------------------------------------------------------------JAVA_OPTS='-Xms8192m -Xmx8192m'export JAVA_HOME=/usr/java/jdk1.8.0_20CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=10085"10085端口自定义,自定义端口号[tomcat@wx01 bin]$ netstat -na | grep 10085tcp 0 0 0.0.0.0:10085 0.0.0.0:* LISTEN 8.重启启动tomcat服务和zabbix_agentd服务9.zabbix服务器端测试是否能正常获取信息zabbix:/root# java -jar /root/cmdline-jmxclient-0.10.3.jar - 120.55.118.32:5566 java.lang:type=Memory NonHeapMemoryUsage10/27/2016 15:23:08 +0800 org.archive.jmx.Client NonHeapMemoryUsage: committed: 83623936init: 2555904max: -1used: 81181776zabbix:/root# java -jar /root/cmdline-jmxclient-0.10.3.jar - 192.168.11.187:10085 java.lang:type=Memory NonHeapMemoryUsage10/27/2016 15:23:37 +0800 org.archive.jmx.Client NonHeapMemoryUsage: committed: 25231360init: 2555904max: -1used: 24549416