-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
54 lines (40 loc) · 1.52 KB
/
install.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
49
50
51
52
53
54
#!/bin/bash
#Script testato solo wu Rocky 8
#Disabiito selinux
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config &> /dev/null
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux &> /dev/null
#Copio readme.txt in /opt/elk
mkdir /opt/elk
cp readme.txt /opt/elk/readme.txt
#Aggiorno il sistema
dnf update -y
#Installo docker e i container elk
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin rsyslog wget vim nc mlocate
updatedb
systemctl enable docker
systemctl start docker
systemctl start rsyslog
systemctl enable rsyslog
echo "set mouse-=a" >> ~/.vimrc
cd /opt/elk/
wget -O /opt/elk/8.2305.1.tar.gz https://github.com/deviantony/docker-elk/archive/refs/tags/8.2305.1.tar.gz
tar xvzf /opt/elk/8.2305.1.tar.gz -C /opt/elk
rm -f /opt/elk/8.2305.1.tar.gz
cd /opt/elk/docker-elk-8.2305.1/
docker compose up setup
docker compose up -d
#Invio qualche log a logstash
echo "Invio qualche log a logstash"
cat /var/log/messages | nc --send-only localhost 50000
#stampo istruzioni per installare winlogbeat su windows
echo "Di seguito le istruzioni per confogurare windows"
cat /opt/elk/readme.txt
hostname -I | grep -o '^[^ ]*' > ipaddress.txt
ipaddress=$(cat ipaddress.txt)
echo "Per aprire l'interfaccia di elk andare su http://$ipaddress:5601"
echo "La login di default è elastic con password changme
echo "La macchina verrà riavviata fra 60 secondi"
sleep 60
init 6