zabbix服务快速搭建指南
zabbix监控服务快速安装指南
1.更换centos7-base源为阿里源
1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2.更换centos7-epel源为阿里源
1 wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
3.安装步骤:
1.安装httpd服务
1 yum install -y httpd
2.安装php组件
1 yum install -y php73.x86_64
3.安装mariadb组件
1 yum install -y mariadb-server
4.安装zabbix组件
1 yum install zabbix40-dbfiles-mysql.noarch zabbix40-server-mysql.x86_64 zabbix40-web-mysql.noarch zabbix40-agent.x86_64
5.创建zabbix数据库并授权zabbix用户权限
1 mysql -u root -p 密码
1 MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; 2 MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'%' identified by 'zabbix'
MariaDB [(none)]>grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix'
4 MariaDB [(none)]>flush privileges;
6.导入zabbix数据库文件到mariadb的zabbix库中
1 mysql -uzabbix -pzabbix zabbix < /usr/share/zabbix-mysql/schema.sql
2 mysql -uzabbix -pzabbix zabbix < /usr/share/zabbix-mysql/images.sql
3 mysql -uzabbix -pzabbix zabbix < /usr/share/zabbix-mysql/data.sql
7.修改zabbix.conf时区为本地时区
1 vim /etc/httpd/conf.d/zabbix.conf
修改第34行处的值为本地时区
1 php_value date.timezone Asia/Shangha
8.修改/etc/zabbix_server.conf配置文件
更改zabbix登录对应的数据库地址以及用户名和端口信息等信息
9.重新启动zabbix相关服务
1 systemctl restart zabbix-server zabbix-agent httpd
10.设置zabbix服务为开机启动
1 systemctl enable zabbix-server-mysql.service zabbix-agent httpd
11.访问zabbix 的web服务并进行相应配置
http://server_ip_or_name/zabbix
*默认登录账号密码:
Admin zabbix
永远不做思想的巨人,行动的矮子!