Apple 10.6 Server User Manual


 
df -Hl
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s9 40G 38G 2.1G 95% /
In this example, the hard disk is almost full with only 2.1 GB left. This tells you that
you should act immediately to free space on your hard disk before it lls up and
causes problems for your users.
 du. This command tells you how much space is used by specic folders or les.
For example, the following command tells you how much space is used by each
user’s home folder:
sudo du -sh /Users/*
3.2M /Users/Shared
9.3M /Users/omar
8.8M /Users/jay
1.6M /Users/lili
Knowing who’s using most of the space on the hard disk lets you contact users and
have them delete unused les.
Note: With Workgroup Manager, you can set disk quotas for users and generate disk
usage reports.
 diskspacemonitor. This command lets you automate the process of monitoring disk
space usage. When the amount of free disk space drops below the level you specify,
diskspacemonitor executes shell scripts that send you a notication. This command
denes two action levels:
Alert—Sends you a warning message when disk space usage reaches 75%. Â
Recover—Archives rarely used les and deletes unneeded les when disk space Â
usage reaches 85%.
For more information about these commands, see the corresponding man page.
Using Network Monitoring Tools
Degradation in network performance or other network problems can adversely aect
the availability of your services. The following network monitoring tools can alert you
to problems early, so you can take corrective action to avoid or minimize down time.
To monitor network activity, use the  tcpdump utility in Mac OS X Server. This utility
prints the headers of incoming and outgoing packets on a network interface that
match specied parameters.
Using tcpdump to monitor network trac is especially useful when trying to detect
denial of service (DoS) attacks. For example, the following command monitors
incoming trac on port 80 on your computer:
sudo tcpdump -i en0 dst port 80
174 Chapter 8 Monitoring Your System