forked from PAPAMICA/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebian_install_zabbix_server.sh
49 lines (45 loc) · 1.89 KB
/
debian_install_zabbix_server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
clear
# Principaux paramètres
tput setaf 7; read -p "Entrez le mot de passe pour la base de données Zabbix : " ZABBIX_DB_USER_PASSWORD
#read -p "Entrez l'adresse ip du serveur : " SERVER_IP
SERVER_IP=$(hostname -i)
tput setaf 2; echo ""
# Installation des dépendances et de docker
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
apt-get update
apt-get -y install docker-ce docker-compose
apt-get install snmpd snmp
systemctl enable docker
systemctl enable snmpd
systemctl start docker
systemctl start snmpd
# Modification et lancement du docker-compose.yml
for file in ~/scripts/zabbix-server/docker-compose.yml
do
echo "Traitement de $file ..."
sed -i -e "s/zabbix-bdd-password/$ZABBIX_DB_USER_PASSWORD/g" "$file"
sed -i -e "s/ip-adress-zabbix/$SERVER_IP/g" "$file"
done
cd ~/scripts/zabbix-server/
docker-compose up -d
clear
tput bold; tput setaf 7; echo "LISTES DES CONTAINERS EN COURS : "
tput setaf 3; echo ""
docker container ls
echo ""
tput setaf 7; echo "-------------------------------------------------"
tput bold; tput setaf 7; echo " => INSTALLATION TERMINEE <="
tput setaf 7; echo ""
tput setaf 7; echo " IP du serveur Zabbix : $SERVER_IP:8090 "
tput setaf 7; echo " ID : Admin / MDP : zabbix "
tput setaf 7; echo ""
tput setaf 7; echo " IP du serveur Grafana : $SERVER_IP:3000 "
tput setaf 7; echo " ID : admin / MDP : admin "
tput setaf 7; echo ""
tput bold; tput setaf 6; echo " By PAPAMICA"
tput bold; tput setaf 6; echo " Labo-Tech.fr"
tput setaf 7; echo "-------------------------------------------------"
tput setaf 2; echo ""