本笔记是基于CentOS 7.2下最小化安装的操作系统搭建的Zabbix4.0环境,主要用于做一些企业路由器和交换机等设备的运行状态监控。
1、安装epel源
Bash
yum -y install epel-release
2、安装php-fpm和mariadb
Bash
yum -y install php-fpm mariadb mariadb-server wget
3、配置zabbix4.0源(我这里主要使用的是清华大学的zabbix镜像源)
Bash
wget -P /etc/yum.repos.d/ http://down.whsir.com/downloads/zabbix.repo
4、安装zabbix4.0
Bash
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
5、启动mariadb
Bash
systemctl enable mariadbsystemctl start mariadb
6、配置mariadb(创建zabbix数据库,默认密码为空,直接enter)
Bash
mysql -u root -p
Bash
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'www.pengqi.club';MariaDB [(none)]> quit
7、导入zabbix数据库
Bash
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pwww.pengqi.club zabbix
8、修改zabbix-server配置文件
Bash
vi /etc/zabbix/zabbix_server.conf
Bash
DBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=www.pengqi.club
9、修改http配置文件,修改时区为亚洲上海
Bash
vi /etc/httpd/conf.d/zabbix.conf
Bash
php_value date.timezone Asia/Shanghai
10、启动相关应用服务并设置开机启动
PowerShell
systemctl enable php-fpmsystemctl start php-fpmsystemctl enable httpdsystemctl start httpdsystemctl enable zabbix-serversystemctl start zabbix-serversystemctl enable zabbix-agentsystemctl start zabbix-agent
11、访问web页面初始化安装zabbix4.0(http://你的IP地址/zabbix/)
温馨提示:
1、需要关闭 selinux,一定要关闭这个,开启selinux会引起一连串问题。
Bash
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
2、关闭防火墙
PowerShell
systemctl start firewalld.service#启动firewallsystemctl stop firewalld.service#停止firewallsystemctl disable firewalld.service#禁止firewall开机启动
感谢您的来访,获取更多精彩文章请收藏本站。
© 版权声明
THE END
暂无评论内容