File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,12 +46,9 @@ ZBX_VERSION_MAJOR=${ZBX_VERSION_ARRAY[0]}
4646ZBX_VERSION_MINOR=${ZBX_VERSION_ARRAY[1]}
4747
4848OLD_ZABBIX=" "
49- if (( ZBX_VERSION_MAJOR <= 4 ))
49+ if (( ZBX_VERSION_MAJOR < 4 ))
5050then
51- if (( ZBX_VERSION_MINOR <= 2 ))
52- then
53- OLD_ZABBIX=" --old-zabbix "
54- fi
51+ OLD_ZABBIX=" --old-zabbix "
5552fi
5653
5754echo && echo " ------> mamonsu zabbix version"
Original file line number Diff line number Diff line change 1717done
1818
1919echo " ================================================================================================================="
20- sudo mkdir 775 -p /docker/zabbix-docker/
20+ sudo mkdir -m 775 -p /docker/zabbix-docker/
2121cd /docker/zabbix-docker/ 2>&1 1> /dev/null
2222sudo wget https://github.com/zabbix/zabbix-docker/archive/refs/tags/${ZBX_VERSION} .zip
2323sudo unzip ${ZBX_VERSION} .zip
2424cd zabbix-docker-${ZBX_VERSION} 2>&1 1> /dev/null
2525echo " ---> Setting up docker with Zabbix ${ZBX_VERSION} ..."
2626# docker-compose dirty hack: it uses only file named 'docker-compose.yml'
2727yes | sudo cp docker-compose_v3_alpine_mysql_latest.yaml docker-compose.yml
28+
29+ # Pin MySQL to 8.0.33 to avoid mysql_native_password deprecation in 8.0.34+
30+ sudo sed -i ' s/mysql:8\.0/mysql:8.0.33/g' docker-compose.yml
31+
2832docker-compose -f ./docker-compose.yml up -d
29- # wait for full set up
30- sleep 1m
33+
34+ echo " ---> Waiting for Zabbix ..."
35+ WAITED=0
36+ until curl -sf http://localhost:80/ > /dev/null 2>&1 ; do
37+ sleep 5
38+ WAITED=$(( WAITED + 5 ))
39+ if [ $WAITED -ge 300 ]; then
40+ echo " ERROR: Zabbix not ready after 300s"
41+ docker-compose -f ./docker-compose.yml ps
42+ docker-compose -f ./docker-compose.yml logs --tail=20
43+ exit 1
44+ fi
45+ done
You can’t perform that action at this time.
0 commit comments