Hi Team,
How to monitor the directory usage in linux server. I have tried below but i have not get % values in the output
root@ip-172-31-94-236:/home/ubuntu# ./check_folder_size_percentage.sh -f /usr/local/file -s g -w 60 -c 80
OK: The folder size is 0%(5.48829GB)|size=5.48829GB percentage=0%
root@ip-172-31-94-236:/home/ubuntu# df -h
Filesystem Size Used Avail Use% Mounted on
udev 488M 0 488M 0% /dev
tmpfs 100M 3.3M 96M 4% /run
/dev/xvda1 7.7G 6.8G 996M 88% /
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/loop0 18M 18M 0 100% /snap/amazon-ssm-agent/1480
/dev/loop1 90M 90M 0 100% /snap/core/8268
/dev/loop2 92M 92M 0 100% /snap/core/8689
/dev/loop3 18M 18M 0 100% /snap/amazon-ssm-agent/1566
tmpfs 100M 0 100M 0% /run/user/1000
root@ip-172-31-94-236:/home/ubuntu# cd /usr/local/file/
root@ip-172-31-94-236:/usr/local/file# du -sh *
0 daygeek1.txt
5.1G daygeek2.txt
501M daygeek3.txt
root@ip-172-31-94-236:/usr/local/file#
How to monitor the directory in linux
-
grayloglearn
- Posts: 222
- Joined: Thu Jul 06, 2017 8:55 am
How to monitor the directory in linux
- Attachments
-
check_folder_size_percentage.txt- (2.73 KiB) Downloaded 229 times
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How to monitor the directory in linux
What is the output of these commands:
Code: Select all
du --max-depth=1 /usr/local/file|tail -1 |awk -v DIVISOR=$divisor '{print $1/DIVISOR}'Code: Select all
which bcAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.