[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@localhost ~]# uname -r
3.10.0-957.el7.x86_64
[root@localhost ~]# systemctl stop firewalld && systemctl disable firewalld
[root@localhost ~]# systemctl status firewalld
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@wms-dbtest ~]# cat /etc/selinux/config
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
[root@wms-dbtest ~]# ll /etc/yum.repos.d/
[root@wms-dbtest ~]# cat /etc/yum.repos.d/zabbix.repo
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
[root@localhost ~]# yum -y install mariadb-server mariadb
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
[root@localhost ~]# netstat -anptu | grep :3306
[root@localhost ~]# mysql_secure_installation ##数据库初始化
mysql -uroot -p
SQL> create database zabbix character set utf8 collate utf8_bin;
SQL> create user zabbix@localhost identified by 'zabbix';
SQL> grant all privileges on zabbix.* to zabbix@
4.4 点击下一步,进入zabbix server配置界面,如下图:localhost;
[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
添加zabbix密码
[root@wms-dbtest /]# vim /etc/zabbix/zabbix_server.conf
[root@localhost ~]# egrep -v "^$|#" /etc/zabbix/zabbix_server.conf
3.8 启动zabbix-server、zabbix-agent和httpd进程,并为它们设置开机自启:
[root@localhost ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@localhost ~]# netstat -anptu | grep zabbix
[root@wms-dbtest /]# netstat -anptu | grep httpd
至此,zabbix-server端便部署完成;
接下来开始部署grafana可视化平台
############################################################################################################################################################################################################################
wget https://dl.grafana.com/oss/release/grafana-7.3.7-1.x86_64.rpm ##在线下载过程比较慢,建议先下载到本地,在上传到服务器里
yum -y install grafana-7.3.7-1.x86_64.rpm
[root@localhost ~]# systemctl start grafana-server && systemctl enable grafana-server
netstat -anptu | grep :3000
http://192.168.16.77:3000,默认用户密码为admin/admin
官网:https://grafana.com/grafana/plugins
6.1 安装zabbix插件
[root@localhost ~]# cd /var/lib/grafana/plugins/
[root@localhost plugins]# grafana-cli plugins install alexanderzobnin-zabbix-app
[root@localhost plugins]# systemctl restart grafana-server
6.2 在grafana添加zabbix插件
至此zabbix数据源已经添加成功;