Update ipcheck.sh

This commit is contained in:
ByeonJungHun
2023-07-03 11:26:32 +09:00
committed by GitHub
parent bd8c65c78e
commit b131201235

View File

@@ -1,10 +1,20 @@
#!/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")
start_ip="10.10.43.100"
end_ip="10.10.43.253"
echo "마지막 수행 시간 : $(date +%Y-%m-%d-%r)<br><br>" > README.md
echo "|IP Address&emsp;&emsp;&emsp;&emsp;&emsp;|Check Result&emsp;&emsp;&emsp;&emsp;&emsp;|" >> 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 "|---|---|---|---|"
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 $2"%"}')|$(ssh root@${xcp_ng[$list]} free -h |awk '/^Mem:/ {print $4}')|$(ssh root@${xcp_ng[$list]} free -h |awk '/^Mem:/ {print $2}')|" >> README.md
done
echo "<br><br>|IP Address&emsp;&emsp;&emsp;&emsp;&emsp;|Check Result&emsp;&emsp;&emsp;&emsp;&emsp;|" >> README.md
echo "|:---|:---|" >> README.md
for i in $(seq ${start_ip##*.} ${end_ip##*.}); do