1.首先安装好mysql,创建好用户和授权
2.安装zabbix
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
有时境外的源下载不动,这时可以换成阿里云的zabbix源
vim /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
然后安装zabbix
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
如果报错Couldn’t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7则按下面方式解决,再重新yum install
cd /etc/pki/rpm-gpg
wget https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
然后登陆mysql创建数据库
mysql> create database zabbix character set utf8 collate utf8_bin;
导入架构和数据
zcat /usr/share/doc/zabbix-server-mysql-4.4.10/create.sql.gz | mysql -uroot -p zabbix
修改配置文件
vim /etc/zabbix/zabbix_server.conf
设置
DBUser=
DBPassword=
修改配置文件
vim /etc/httpd/conf.d/zabbix.conf
将# php_value date.timezone Europe/Riga 去掉注释改为
php_value date.timezone Asia/Shanghai
启动服务
systemctl start httpd
systemctl enable httpd
systemctl start zabbix-server
systemctl enable zabbix-server
systemctl start zabbix-agent
systemctl enable zabbix-agent
然后登陆网页
默认账户密码 Admin zabbix