-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1268 from seokho-son/main
Add weavescope script
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
|
||
echo "[Start Weave Scope Cluster Monitoring]" | ||
|
||
SECONDS=0 | ||
|
||
PublicIPs=${1} | ||
PrivateIPs=${2} | ||
|
||
echo "Installing Weavescope to MCIS..." | ||
|
||
ScopeInstallFile="git.io/scope" | ||
ScopeInstallFile="https://gist.githubusercontent.com/seokho-son/bb2703ca49555f9afe0d0097894c74fa/raw/9eb65b296b85bc53f53af3e8733603d807fb9287/scope" | ||
sudo curl -L $ScopeInstallFile -o /usr/local/bin/scope | ||
sudo chmod a+x /usr/local/bin/scope | ||
|
||
FILE="/usr/local/bin/scope" | ||
|
||
echo "Installing prerequisite" | ||
sudo apt-get update > /dev/null | ||
sudo apt install docker.io -y | ||
|
||
PID=$(ps -ef | grep scope | awk '{print $2}') | ||
|
||
if [ "${PID}" != "" ]; then | ||
echo "scope ${PID} exist. sudo scope stop" | ||
sudo scope stop | ||
fi | ||
|
||
echo "Launching Weavescope" | ||
|
||
sudo scope launch $PublicIPs $PrivateIPs | ||
|
||
echo "Done! elapsed time: $SECONDS" | ||
|
||
IP=$(curl https://api.ipify.org) | ||
|
||
PID=$(ps -ef | grep scope | awk '{print $2}') | ||
|
||
|
||
echo "[Start Scope: complete] PID=$PID" | ||
echo "$IP:4040/#!/state/{\"contrastMode\":true,\"topologyId\":\"containers-by-hostname\"}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
PS=$(ps -ef | head -1; ps -ef | grep scope) | ||
echo "[Process status of scope]" | ||
echo "$PS" | ||
|
||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
echo "[Stop Weave Scope Cluster Monitoring]" | ||
|
||
PID=$(ps -ef | grep scope | awk '{print $2}') | ||
sudo scope stop | ||
echo "[Stop scope] PID=$PID" | ||
echo "[Check scope Process]" | ||
sleep 2 | ||
ps -ef | grep scope | ||
|
||
echo "" |