#!/bin/bash
#關閉防火牆,關閉selinux
systemctl stop firewalld
setenforce 0
#配置yum源
"已存在"
#安裝zabbix元件
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb mariadb-server
else
echo
"不存在"
exit
fisystemctl start mariadb
netstat -lnpt |grep 3306
if[ $? -eq 0 ]
;then
echo
"service is started"
else
echo
"service not started"
fi#資料庫的操作
mysql_exec(
)mysql_exec
count=`mysql -e "use zabbix; show tables;"
|grep -v tables |grep -v tables_in_zabbix |wc -l`if[
$count
-gt 0 ]
;then
echo
"tables is exists"
else
#匯入初始資料庫
zcat /usr/share/doc/zabbix-server-mysql-4.0.14/create.sql.gz |mysql -uzabbix -p123 zabbix
fi#修改配置檔案
sed -i 's/# dbpassword=/dbpassword=123/'
/etc/zabbix/zabbix_server.conf
#編輯php檔案
sed -i 's/\;date.timezone =/date.timezone = asia\/shanghai/'
/etc/php.ini
#啟動服務
#驗證埠是否存在
shell 一鍵部署 zabbix4 0
bin bash 關閉防火牆,關閉selinux systemctl stop firewalld setenforce 0 配置yum源 rpm ivh if e etc yum.repos.d zabbix.repo then echo 已存在 安裝zabbix元件 yum y install ...
安裝部署 Zabbix 4 0
centos 7.7 1908 zabbix 4.0 lts 2.1 新增zabbix映象源 rpm ivh2.2 關閉並停用防火牆 systemctl stop firewalld.service systemctl disable firewalld.service3.3 停用selinux 修...
zabbix一鍵部署
bin bash 關閉防火牆,關閉selinux systemctl stop firewalld setenforce 0 配置yum源 rpm ivh if e etc yum.repos.d zabbix.repo then echo 已存在 安裝zabbix元件 yum y install ...