-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-demo.sh
executable file
·99 lines (78 loc) · 2.29 KB
/
01-demo.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
source ./config.sh
menu_option_1() {
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Introduce anomaly into ratings Service in BookInfo App ...started ....$date1"
events-push/push-events.sh
iks/iks-login.sh
iks/induce-log-error.sh
log-load/log-load-generate.sh
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Introduce anomaly into ratings Service in BookInfo App...completed ....$date1"
}
menu_option_2() {
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Check Metric Anomaly in BookInfo App ...started .... $date1"
metrics/push-metrics-event.sh
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Check Metric Anomaly in BookInfo App ...completed ....$date1"
}
menu_option_3() {
echo "Process completed...."
}
menu_option_4() {
echo "Process completed...."
}
menu_option_5() {
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Clear events and log anomaly ...started ....$date1"
events-clear/clear-events.sh
iks/iks-login.sh
iks/clear-log-error.sh
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Clear events and log anomaly ...completed ....$date1"
}
menu_option_6() {
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Reset ...started ....$date1"
events-clear/clear-events.sh
iks/iks-login.sh
iks/clear-log-error.sh
ai-manager-reset/reset-aimanager.sh
date1=$(date '+%Y-%m-%d %H:%M:%S')
echo "Reset ...completed ....$date1"
}
press_enter() {
echo ""
read -p " Press Enter to continue "
clear
}
incorrect_selection() {
echo "Incorrect selection! Try again."
}
clear
until [ "$selection" = "0" ]; do
echo ""
echo " Watson AI-Ops Demo "
echo " -------------------"
echo ""
echo " 1 - Introduce anomaly into BookInfo App"
echo " 2 - Check Metric Anomalyin BookInfo App performance Metrics"
echo " 5 - Clear events and log anomaly"
echo " 6 - Reset"
echo ""
echo " 0 - Exit"
echo ""
read -p " Enter selection: " selection
echo ""
case $selection in
1 ) clear ; menu_option_1 ; press_enter ;;
2 ) clear ; menu_option_2 ; press_enter ;;
3 ) clear ; menu_option_3 ; press_enter ;;
4 ) clear ; menu_option_4 ; press_enter ;;
5 ) clear ; menu_option_5 ; press_enter ;;
6 ) clear ; menu_option_6 ; press_enter ;;
0 ) clear ; exit ;;
* ) clear ; incorrect_selection ; press_enter ;;
esac
done