48
Monitoring Disk Space
When you need more vigilant monitoring of disk space than the log rolling scripts provide, you can use the diskspacemonitor
diskspacemonitor is disabled by default. You can enable it by opening a Terminal window and typing sudo diskspacemonitor on. You may be prompted for your password. Type man diskspacemonitor for more information about the command- line options.
When enabled, diskspacemonitor uses information in a configuration file to determine when to execute alert and recovery scripts for reclaiming disk space:
•The configuration file is /etc/diskspacemonitor/diskspacemonitor.conf. It lets you specify how often you want to monitor disk space and thresholds to use for determining when to take the actions in the scripts. By default, disks are checked every 10 minutes, an alert script executed when disks are 75% full, and a recovery script executed when disks are 85% full. To edit the configuration file, log in to the server as an administrator and use a text editor to open the file. See the comments in the file for additional information.
•By default, two predefined action scripts are executed when the thresholds are reached.
The default alert script is /etc/diskspacemonitor/action/alert. It runs in accord with instructions in configuration file /etc/diskspacemonitor/alert.conf. It sends email to recipients you specify.
The default recovery script is /etc/diskspacemonitor/action/recover. It runs in accord with instructions in configuration file /etc/diskspacemonitor/recover.conf.
See the comments in the script and configuration files for more information about these files.
•If you want to provide your own alert and recovery scripts, you can. Put your alert script in /etc/diskspacemonitor/action/alert.local and your recovery script in /etc/diskspacemonitor/action/recovery.local. Your scripts will be executed before the default scripts when the thresholds are reached.
To configure the scripts on a server from a remote Mac OS X computer, open a Terminal window and log in to the remote server using SSH.
Chapter 6 Working With Disks and Volumes