zabbix一键部署
#!/bin/bash#首先关闭防火墙以及SElinuxsystemctl stop firewalldsetenforce 0#拉取官方源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-server-mysql zabbix-web-mysql mariadb mariadb-server zabbix-server zabbix-agentyum -y install zabbix-server-mysql zabbix-web-mysql mariadb mariadb-server zabbix-server zabbix-agentyum -y install zabbix-server-mysql zabbix-web-mysql mariadb mariadb-server zabbix-server zabbix-agent#启动数据库创建库并授权用户systemctl start mariadbmysql -e "create database zabbix;"mysql -e "grant all on zabbix.* to ‘tom‘@‘localhost‘ identified by ‘123‘;"mysql -e "flush privileges;"#导入初始数据cd /usr/share/doc/zabbix-server-mysql-4.4.1/ && zcat create.sql.gz | mysql -utom -p123 zabbix#修改zabbix-server配置文件sed -i ‘s/# DBPassword=/DBPassword=123/g‘ /etc/zabbix/zabbix_server.confsed -i ‘s/DBUser=zabbix/DBUser=tom/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#启动所有服务yum -y install httpdsystemctl restart zabbix-server zabbix-agent httpd
可通过本机IP/zabbix 来进行web页面的安装展示
相关推荐
CoderToy 2020-11-16
bianruifeng 2020-11-16
云中舞步 2020-11-12
敏敏张 2020-11-11
暗夜之城 2020-11-11
好记忆也需烂 2020-11-11
Coder技术文摘 2020-09-29
huacuilaifa 2020-10-29
Gexrior 2020-10-22
lpfvip00 2020-10-07
云中舞步 2020-09-11
康慧欣 2020-09-10
silencehgt 2020-09-07
幸福ITman汪文威 2020-09-05
sofia 2020-09-03
nan00zzu 2020-08-19
CHINA华军 2020-08-18
cyhgogogo 2020-08-18