服务器端:
ip为192.168.227.187
1.安装yum源,阿里源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.rep
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
2.安装zabbix
yum install -y zabbix-server-mysql zabbix-web-mysql
3.安装启动maridb数据库
yum install mariadb.service -y
systemctl start mariadb.service
systemctl enable mariadb.service
4.创建数据库
mysql -e ‘create database zabbix character set utf8 collate utf8_bin;’
mysql -e ‘grant all privileges on zabbix.* to zabbix@localhost identified by “zabbix”;’
5.导入数据库
使用create.sql.gz文件生成我们所需的表
zcat /usr/share/doc/zabbix-server-mysql-3.0.26/create.sql.gz | mysql -uzabbix -pzabbix zabbix
6.配置zabbixservice连接mysql
vi /etc/zabbix/zabbix_service.conf
修改第144行的DBPassword
7.添加时区
sed -i.ori ‘18a php_value date.timezone Asia/Shanghai’ /etc/httpd/conf.d/zabbix.conf
8.启动服务
systemctl start zabbix-server
systemctl enable zabbix-server
systemctl start httpd
systemctl enable httpd
9.访问安装
http://192.168.227.187/zabbix/setup.php
进入登陆界面
账号:Admin 密码:zabbix
(首字母A大写)
客户端:
IP为192.168.227.189
1.安装yum源,阿里源
2.安装zabbix,并启动服务
yum install zabbix-agent
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
3.服务器端添加被监控主机
选择“配置”,“主机”
选择“创建主机”
添加成功: