zabbix 3.4 编译
# tar -zxvf zabbix-3.4.tar.gz
# cd zabbix-3.4
# ./configure –prefix=/usr/local/zabbix/ –enable-server –enable-agent –with-mysql –with-net-snmp –with-libcurl –with-libxml2 –enable-java
# make && make install
配置:
/etc/zabbix/zabbix-server.conf
DBHost=localhost
DBUser=zabbix
DBPassword=root
DBPort=3306
#gateway地址
JavaGateway=192.168.80.128
#预启动进程轮训个数
StartJavaPollers=5
ListenIP=127.0.0.1,192.168.80.128
配置tomcat
tomcat的bin文件夹增加 setenv.sh(windows下为setenv.bat)
-- setenv
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=192.168.80.128”
-- jmxcmd.jar下载地址,不同的版本选择不同的tomcat进入 http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.73/bin/extras/ jmx-remote.jar
-- 测试jmx是否通
java -jar jmxcmd.jar - 192.168.80.128:12345 java.lang:type=Memory NonHeapMemoryUsage
192.168.80.128:12345 为tomcat所在地址,端口默认 12345
tomcat启动如果报类似错误
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: bogon: bogon: Temporary failure in name resolution
则需要修改 /etc/hosts
添加 127.0.0.1 bogon
查看hostname的方法
# hostname
修改hostname的方法
# hostname cg
# vi /etc/sysconfig/network