Update ipcheck.sh

This commit is contained in:
ByeonJungHun
2023-07-03 13:50:43 +09:00
committed by GitHub
parent 59b7db1a4d
commit cc9cbe82ea

View File

@@ -1,7 +1,7 @@
#!/bin/bash
xcp_ng=("10.10.43.31" "10.10.43.32" "10.10.43.33" "10.10.43.34" "10.10.43.35" "10.10.43.36" "10.10.43.38" "10.10.43.39" "10.10.31.61" "10.10.31.38")
xcp_ng_name=("xcp-ng-31" "xcp-ng-32" "xcp-ng-33" "xcp-ng-34" "xcp-ng-35" "xcp-ng-36" "xcp-ng-38" "xcp-ng-39" "xen6" "xen7")
dsk_ip_start="10.10.43.111"
dsk_ip_end="10.10.43.147"
start_ip="10.10.43.100"
end_ip="10.10.43.253"
@@ -10,8 +10,9 @@ echo "마지막 수행 시간 : $(date +%Y-%m-%d-%r)<br><br>" > README.md
echo "## XCP-NG Status" >> README.md
echo "|Server&emsp;&emsp;&emsp;&emsp;&emsp;|CPU&emsp;&emsp;&emsp;&emsp;&emsp;|Use Memory&emsp;&emsp;&emsp;&emsp;&emsp;|Total Memory&emsp;&emsp;&emsp;&emsp;&emsp;|" >> README.md
echo "|---|---|---|---|" >> README.md
for list in 0 1 2 3 4 5 6 7 8 9; do
echo "|${xcp_ng_name[$list]}|$(ssh root@${xcp_ng[$list]} mpstat |grep all |awk '{print $4"%"}')|$(ssh root@${xcp_ng[$list]} free -h |awk '/^Mem:/ {print $4}')|$(ssh root@${xcp_ng[$list]} free -h |awk '/^Mem:/ {print $2}')|" >> README.md
for i in $(seq ${dsk_ip_start##*.} ${dsk_ip_end##*.}); do
ip="${start_ip%.*}.${i}"
echo "|$(ssh ubuntu@$ip hostname)|$(ssh ubuntu@$ip mpstat |grep all |awk '{print $4"%"}')|$(ssh ubuntu@$ip free -h |awk '/^Mem:/ {print $4}')|$(ssh ubuntu@$ip free -h |awk '/^Mem:/ {print $2}')|" >> README.md
done
echo "## IP Health Check" >> README.md