Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weavescope script #1268

Merged
merged 1 commit into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions scripts/usecases/weavescope/startServer.sh
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\"}"
7 changes: 7 additions & 0 deletions scripts/usecases/weavescope/statusServer.sh
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 ""
12 changes: 12 additions & 0 deletions scripts/usecases/weavescope/stopServer.sh
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 ""