forked from nightscout/cgm-remote-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
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 nightscout#20 from Navid200/VerifyVM
Verify Virtual Machine
- Loading branch information
Showing
3 changed files
with
94 additions
and
40 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 |
---|---|---|
@@ -1,26 +1,65 @@ | ||
#!/bin/bash | ||
|
||
# Show a summary of parameters. - Navid200 | ||
clear | ||
echo "Please be patient (30 seconds)" | ||
echo " " | ||
echo " " | ||
|
||
cd /tmp | ||
echo " Developed by the xDrip team " > tmp | ||
echo " " >> tmp | ||
echo "--------------------------------------------------" >> tmp | ||
lsb_release -a | sed -n 2p >> tmp | ||
echo " " >> tmp | ||
echo "--------------------------------------------------" >> tmp | ||
free -h | sed -n 3p >> tmp | ||
echo " " >> tmp | ||
echo "--------------------------------------------------" >> tmp | ||
df -m . >> tmp | ||
echo " " >> tmp | ||
echo "--------------------------------------------------" >> tmp | ||
echo "MongoDB" >> tmp | ||
mongod --version | sed -n 1p >> tmp | ||
echo " " >> tmp | ||
echo "--------------------------------------------------" >> tmp | ||
echo "Nightscout process" >> tmp | ||
ps -ef | grep SCREEN | grep root | fold --width=40 | sed -n 1p >> tmp | ||
|
||
dialog --colors --textbox tmp 25 50 | ||
Ram=$(free -m | sed -n 2p | awk '{print $2}') | ||
unit="M" | ||
Ramsize="$Ram"$unit | ||
if [ $Ram -gt 1000 ] | ||
then | ||
Ramsize="\Zb\Z1 $Ram$unit \Zn" | ||
fi | ||
|
||
disk="\Z1\ZbBalanced\Zn" | ||
if [ $(cat /sys/block/sda/queue/rotational) -eq 1 ] | ||
then | ||
disk="Standard" | ||
fi | ||
|
||
disksz="$(df -h | sed -n 2p | awk '{print $2}')" | ||
if [ ! "$disksz" = "29G" ] | ||
then | ||
disksz="\Zb\Z1$(df -h | sed -n 2p | awk '{print $2}')\Zn" | ||
fi | ||
|
||
swap="$(free -h | sed -n 3p | awk '{print $2}')" | ||
|
||
ubuntu="$(lsb_release -a | sed -n 2p | awk '{print $3, $4}')" | ||
if [ ! "$ubuntu" = "20.04.5 LTS" ] | ||
then | ||
ubuntu="\Zb\Z1$(lsb_release -a | sed -n 2p | awk '{print $3, $4}')\Zn" | ||
fi | ||
|
||
current=$(wget -q -O - http://checkip.dyndns.org|sed s/[^0-9.]//g) | ||
nc -zvw10 $current 80 2> /tmp/http | ||
grep 'timed out' /tmp/http > /tmp/http2 | ||
nc -zvw10 $current 443 2> /tmp/https | ||
grep 'timed out' /tmp/https > /tmp/https2 | ||
http="Open" | ||
if [ -s /tmp/http2 ] || [ -s /tmp/https2 ] | ||
then | ||
http="\Zb\Z1Closed\Zn" | ||
fi | ||
|
||
|
||
mongo="$(mongod --version | sed -n 1p)" | ||
ns="$(ps -ef | grep SCREEN | grep root | fold --width=40 | sed -n 1p)" | ||
|
||
dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\ | ||
\Zb Status \Zn \n\\n | ||
\ZbVirtual Machine\Zn \n\ | ||
RAM: $Ramsize \n\ | ||
Disk type: "$disk" \n\ | ||
Disk size: $disksz \n\ | ||
Ubuntu: $ubuntu \n\ | ||
HTTP & HTTPS: $http \n\n\ | ||
------------------------------------------ \n\ | ||
Swap: $swap \n\ | ||
Mongo: $mongo \n\ | ||
NS proc: $ns \n\ | ||
" 21 50 | ||
|
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
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