zabbix 一键部署

1.手动安装一下zabbix 

rpm -ivh http://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum -y install zabbix zabbix-web-mysql zabbix-server-mysql zabbix-agent httpd

2.确保mysql的情况下使用一下脚本

#!/bin/bash
#rpm -ivh http://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
#yum -y install zabbix zabbix-web-mysql zabbix-server-mysql zabbix-agent httpd
#while [ $? -ne 0 ] 
#do
#yum -y install zabbix zabbix-web-mysql zabbix-server-mysql zabbix-agent httpd
#done

mysql -e "drop database zabbix;"
mysql -e "create database zabbix;"
mysql -e "grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';"
mysql -e "flush privileges;"
cd /usr/share/doc/zabbix-server-mysql-4.4.5
zcat create.sql.gz |mysql zabbix -uzabbix -pzabbix
sed -i 's/# DBPassword=/DBPassword=zabbix/g' /etc/zabbix/zabbix_server.conf
sed -i 's/# DBHost=/DBHost=zabbix/g' /etc/zabbix/zabbix_server.conf
sed -i 's/# php_value date.timezone Europe\/Riga/php_value date.timezone Asia\/Shanghai/g' /etc/httpd/conf.d/zabbix.conf
systemctl restart mariadb
systemctl stop httpd
systemctl start httpd
systemctl restart httpd
systemctl stop zabbix-server
systemctl start zabbix-server
systemctl restart zabbix-server

  

  

  

posted @ 2020-02-12 14:48  Databasess  阅读(603)  评论(0编辑  收藏  举报