-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
72 lines (46 loc) · 1.97 KB
/
setup.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
echo hello1 > log.txt
zippassword=$1
bloburl=$2
storagekey=$3
hostname
uname -a
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get autoremove -y
sudo apt-get install p7zip-full -y
mkdir payload
7z x payload.7z -opayload -p$zippassword
sudo apt-get install metricbeat -y
sudo systemctl enable metricbeat
sudo mv /etc/metricbeat/metricbeat.yml /etc/metricbeat/metricbeat.bak.yml
sudo cp payload/metricbeat.yml /etc/metricbeat/metricbeat.yml
sudo diff /etc/metricbeat/metricbeat.bak.yml /etc/metricbeat/metricbeat.yml || true
sudo systemctl start metricbeat
sudo apt-get install filebeat -y
sudo systemctl enable filebeat
sudo mv /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.bak.yml
sudo cp payload/filebeat.yml /etc/filebeat/filebeat.yml
sudo diff /etc/filebeat/filebeat.bak.yml /etc/filebeat/filebeat.yml || true
sudo systemctl start filebeat
wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64
tar -xf azcopy.tar.gz
sudo ./install.sh
sudo apt-get install npm nodejs -y
sudo npm install npm --global
sudo npm install -g api-spec-converter --unsafe-perm=true --allow-root
sudo npm install -g artillery --unsafe-perm=true --allow-root
sudo artillery -V
sudo artillery run payload/artillery.yml -o result.json
ls -la
ls -la payload
sudo artillery report result.json -o result.html
sudo find /var/lib/waagent -name stdout -exec cp '{}' ./stdout.txt \;
sudo find /var/lib/waagent -name errout -exec cp '{}' ./errout.txt \;
sudo cp /var/log/metricbeat/metricbeat ./metricbeat.txt
sudo cp /var/log/filebeat/filebeat ./filebeat.txt
7z a -mx9 result.7z -mhe -p$zippassword result.json result.html stdout.txt errout.txt metricbeat.txt filebeat.txt
resulturl=$bloburl/result.7z
sudo azcopy --source result.7z --destination $resulturl --dest-key $storagekey
echo hello2 >> log.txt