自己编写的 zabbix
5.12 做的 zabbix 文档: 在 centos 7 环境下做 zabbix
装机 zabbix
- systemctl stop firewalld
- setenforce 0
代表图例
杀死 pid
rm -rf /var/run/yum.pid
安装 Apache,php, mariadb
yum -y install httpd mariadb mariadb-server php php-mysql php-gd
启动 mariadb
- systemctl enable mariadb.service
- systemctl start mariadb.service
初始化数据库, 创建 root 密码
mysql_secure_installation
创建 zabbix 数据库及其用户
- mysql -uroot -p123456 -e "create database zabbix default character set utf8 collate utf8_bin;"
- mysql -uroot -p123456 -e "grant all on zabbix.* to zabbix@localhost identified by'zabbix';"
测试 zabbix 数据库及其用户
mysql -uzabbix -pzabbix
启动 Apache 及开放端口
- systemctl start httpd.service
- netstat -ltun
安装 zabbix
- wget http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
- rpm -ivh zabbix-release-3.4-2.el7.noarch.rpm
- yum -y install zabbix-server-mysql.x86_64 zabbix-web-mysql zabbix-agent
Create.sql.gz 导入数据库
- cd /usr/share/doc/zabbix-server-mysql-3.4.9/
- zcat create.sql.gz | mysql -uroot -p123456 zabbix
编辑 zabbix 配置文件, 开启 zabbix
- vim /etc/httpd/conf.d/zabbix.conf
- vim /etc/zabbix/zabbix_server.conf
- DBHost=localhost
- DBName=zabbix
- DBUser=zabbix
- DBPassword=zabbix
- wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/7.0/x86_64/os/Packages/gnutls-3.1.18-8.el7.x86_64.rpm
- yum -y remove gnutls-dane-3.3.8-12.el7.x86_64
- rpm -Uvh --force gnutls-3.1.18-8.el7.x86_64.rpm
- systemctl start zabbix-server.service
编辑 php.ini 配置文件
vim /etc/php.ini
重启 apache
systemctl restart httpd.service
网页登入:
http://192.168.126.129/zabbix/setup.php
, 网页安装 zabbix 步骤
来源: http://www.bubuko.com/infodetail-2720083.html