File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ service=$1
4
+
5
+ if [ -z ${service} ]; then
6
+ echo " You must pass a service:"
7
+ echo " ./monitor.sh web"
8
+ exit ;
9
+ fi
10
+
11
+ sessionname=" monitor-$service "
12
+ setdockerhost=" export DOCKER_HOST=192.168.99.201; "
13
+ watch=" $setdockerhost ; watch -d -n 0.5 "
14
+ servicels=" $watch docker service ls"
15
+ serviceinspect=" $watch docker service inspect $service "
16
+ serviceps=" $watch docker service ps $service "
17
+
18
+ tmux kill-session -t $sessionname
19
+
20
+ tmux set-option remain-on-exit on
21
+
22
+
23
+ tmux new-session -d -s $sessionname
24
+ # tmux send-keys "$serviceinspect" C-m
25
+ # tmux split-window -p 50 -h
26
+ tmux send-keys " $servicels " C-m
27
+
28
+ tmux split-window -p 75 -v
29
+ tmux send-keys " $serviceps " C-m
30
+
31
+ tmux split-window -p 30 -v
32
+ # tmux select-pane -t 2
33
+ tmux send-keys " $setdockerhost ; clear" C-m
34
+
35
+
36
+
37
+ tmux -2 attach-session -d -t $sessionname
You can’t perform that action at this time.
0 commit comments