One Hat Cyber Team
Your IP :
18.222.215.20
Server IP :
192.145.235.60
Server :
Linux ngx365.inmotionhosting.com 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
sharedrads
/
oldrads
/
Edit File:
trend_disk
#!/usr/bin/bash # This script shows the available disk space for the month on a given shared server # written by Erik S. ext 834 e@inmotion.net #lets set some important variables SESSIONID=`date +%s` MONTH=`date '+%b'` FULLMONTH=`date '+%B'` DAY=`date '+%d'` HOUR=`date '+%H'` TODAY=$DAY OURSERVER=`hostname -s` if [ -f /opt/sharedrads/radsfunctions.sh ]; then source /opt/sharedrads/radsfunctions.sh else source /opt/dedrads/radsfunctions.sh fi #if we got a flag passed, skip the fanciness if [ -z "$1" ]; then if [ "$RADSCOLORS" == "off" ]; then radsbanner-nocolor else radsbanner fi echo " SHOWING DAILY AVAILABLE DISK SPACE TREND IN MEGABYTES(MB) FOR THIS MONTH" ; echo fi cat /var/log/sa/rads/diskavail/* | awk ' BEGIN { printf "%-7s %-20s %-20s %-30s\n", "DAY", "PREVIOUS", "CURRENT", "CHANGE +/-"; } { if (NR==1) { previous = $2; } current=$2; rateofchange = current - previous; printf "%-7s %-20s %-20s %-30s\n",NR,(previous/1024),(current/1024),(rateofchange/1024); #printf "%s ",(rateofchange/1024)/1024; previous = current ; } END{ printf "\n"; } ' | head -`expr $DAY + 1` > /tmp/.$SESSIONID AVGDAILY=`cat /tmp/.$SESSIONID | grep -v CHANGE | awk '{ SUM += $4 } END { print SUM/$1 }'` if [ "$1" == "--avg" ]; then echo "$OURSERVER $AVGDAILY MB/day (average)" exit 0 else cat /tmp/.$SESSIONID echo echo " The average disk trend for $FULLMONTH is: $AVGDAILY MB/day" echo fi rm -f /tmp/.$SESSIONID #cleanup
Simpan