方法一
zabbix实现JMX模块的使用
scp jdk-8u121-linux-x64.rpm apache-tomcat-8.5.24.tar.gz server2:/root/
server2 作为javaMX 用到了tomcat
yum install jdk-8u121-linux-x64.rpm -y
tar zxf apache-tomcat-8.5.24.tar.gz -C /usr/local/
[root@server2 ~]# cd /usr/local/
[root@server2 local]# ln -s apache-tomcat-8.5.24/ tomcat
cd /usr/local/tomcat/bin/
vim catalina.sh
CATALINA_OPTS='-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8888
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false'
/usr/local/tomcat/bin/startup.sh
server1 充当java-gateway
安装java-gateway
yum install zabbix-java-gateway-4.0.5-1.el7.x86_64.rpm -y
systemctl start zabbix-java-gateway
[root@server1 4.0]# netstat -tnapl |grep 10052
tcp6 0 0 :::10052 :::* LISTEN 28466/java
vim /etc/zabbix/zabbix_server.conf
JavaGateway=172.25.11.1
JavaGatewayPort=10052
StartJavaPollers=5
[root@server1 4.0]# zabbix_server -R config_cache_reload
zabbix_server [29256]: command sent successfully
systemctl restart zabbix-server
但是这个监控项太少了
所以删掉重新添加了一个监控项多的
补充dell服务器的使用
ipmitool -H 172.25.254.201 -U root -P westos power status
ipmitool -H 172.25.254.201 -U root -P westos power on
开机
获取传感器信息
ipmitool -H 172.25.254.201 -U root -P westos sensor
方法二节省server2被动资源
选择全克隆
再模板选择你的备份模板,然后选择监控项,下面全选后批量更新
更换为你的主动模板
server2
vim /etc/zabbix/zabbix_agentd.conf
StartAgents=0
systemctl restart zabbix-agent
就可以节省被动资源
方法三 使用zabbix-proxy-mysql
节省server资源
实现数据流 server -> proxy ->agent
修改serve3 名字为proxy
hostnamectl set-hostname proxy
systemctl stop zabbix-agent
修改解析
有上角添加代理
proxy端
yum install fping-3.10-1.el7.x86_64.rpm zabbix-proxy-mysql-4.0.5-1.el7.x86_64.rpm mariadb-server -y
systemctl start mariadb
mysql
create database zabbix_proxy character set utf8 collate utf8_bin;
grant all privileges on zabbix_proxy.* to zabbix@localhost identified by 'westos';
zcat /usr/share/doc/zabbix-proxy-mysql-4.0.5/schema.sql.gz |mysql zabbix_proxy
vim /etc/zabbix/zabbix_proxy.conf
Server=172.25.11.1
ServerPort=10051
Hostname=proxy
DBPassword=westos
JavaGateway=172.25.11.1
JavaGatewayPort=10052
StartJavaPollers=5
systemctl start zabbix-proxy
server2
vim /etc/zabbix/zabbix_agentd.conf
Server=172.25.11.3
StartAgents=5
ServerActive=172.25.11.3
server2
systemctl restart zabbix-agent
/usr/local/tomcat/bin/startup.sh
proxy
systemctl restart zabbix-proxy
server1
zabbix_server -R config_cache_reload
systemctl restart zabbix-server zabbix-agent
zabbix总结
聚合图形集中显示