安装环境
[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
关闭防火墙
Centos 7.3开始iptables就不存在了改成firewalld了,关闭掉方便点
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
关闭SElinux
SElinux是美国国家安全局开发的安全子系统,很麻烦,关闭了。
[[email protected] ~]# vim /etc/selinux/config
把SELNUX=enforcing换成SELINUX=disabled
,我们修改了SEliunx的配置文件,是重启后的状态,但是不影响现在的状态,所以要关闭当前启用的SElinux
[[email protected] ~]# setenforce 0
现在SElinux关闭了
数据库安装与配置
安装MariaDB数据库
[[email protected] ~]# yum install mariadb-server mariadb –y
mariadb数据库相关命令
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动
安装及配置Zabbix3.4
安装源码库配置部署包
[[email protected] ~]# rpm -ivhhttp://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
安装Zabbix部署包
使用Mysql数据库安装Zabbix server、WEB前端和代理
[[email protected] ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
创建数据库
[[email protected] /]# systemctl start mariadb
[[email protected] /]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[[email protected] /]# mysql -uroot -p
Enter password: #空密码
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit
导入初始架构和数据。系统将提示您输入新创建的密码。
[[email protected] /]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
配置Zabbix服务器的数据库
[[email protected] /]# DBPassword=zabbix
然后编辑下面的文件
[[email protected] ~]# vim /etc/zabbix/zabbix_server.conf
在126行加入DBPassword=zabbix
启动Zabbix Server进程
[[email protected] /]# systemctl restart zabbix-server zabbix-agent httpd
[[email protected] /]# systemctl enable zabbix-server zabbix-agent httpd
编辑Zabbix前端PHP配置,更改时区
[[email protected] /]# vim /etc/httpd/conf.d/zabbix.conf
修改完成后需要重启Apache Web服务器
[[email protected] /]# systemctl restart httpd
[[email protected] /]# systemctl enable httpd
安装Zabbix Web
完成后会生成配置文件
[[email protected] /]# more /etc/zabbix/web/zabbix.conf.php
安装完成,默认用户名Admin密码zabbix
安装完成
转发自:http://www.azurew.com/7930.html