-
Notifications
You must be signed in to change notification settings - Fork 0
/
servinfo.sh
21 lines (20 loc) · 1009 Bytes
/
servinfo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
memTotal_b=`free -b |grep Mem |awk '{print $2}'`
memFree_b=`free -b |grep Mem |awk '{print $4}'`
memBuffer_b=`free -b |grep Mem |awk '{print $6}'`
memCache_b=`free -b |grep Mem |awk '{print $7}'`
memTotal_m=`free -m |grep Mem |awk '{print $2}'`
memFree_m=`free -m |grep Mem |awk '{print $4}'`
memBuffer_m=`free -m |grep Mem |awk '{print $6}'`
memCache_m=`free -m |grep Mem |awk '{print $7}'`
CPUPer=`top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}'`
uptime=`uptime`
ProcessCnt=`ps -A | wc -l`
memUsed_b=$(($memTotal_b-$memFree_b-$memBuffer_b-$memCache_b))
memUsed_m=$(($memTotal_m-$memFree_m-$memBuffer_m-$memCache_m))
memUsedPrc=$((($memUsed_b*100)/$memTotal_b))
echo "📌مقدار رم: $memTotal_m MB"
echo "📌میزان رم در حال استفاده: $memUsed_m MB - $memUsedPrc% used!"
echo '📌سی پیو درحال استفاده : '"$CPUPer"'%'
echo '📌تعداد برنامه های درحال اجرا : '"$ProcessCnt"
echo '📌اپتایم سرور : '"$uptime"
echo 'By:@sajjad_021'