Monday, March 30, 2009

Diskcheck: Monitoring File Systems on Linux Fedora

the main command to see the file system status is df, that show the system's disk space usage (in kilobyte). if you want a more readable report in megabytes and gigabytes use the command df -h. it's useful to customize this command with the alias command.

if you need to know the size of a specified folder you can use the du command. it will show the size of every subfolder and as last value, the total size. if you only need this last information you can use the command du -hs

Diskcheck is a simple utility that monitors the amount of free disk space on the system and send email to the system administrator when one or more disk drives reach a specified capacity.
You can download it from here
To install it: as root rpm -ivh diskcheck-3.1.1-4.noarch.rpm
This utility is run as an hourly cron task, so you need the crond service running.
You can customize this utility by editing /etc/diskcheck.conf file.

  • defaultCutoff — When disk drives reach this percent capacity, it will be reported. For example, if defaultCutoff = 90, an email will be sent when the monitored disk drives reach 90% capacity.
  • cutoff[/dev/partition] — Override the defaultCutoff for the partition. For example, if cutoff['/dev/hda3'] = 50 is specified, diskcheck will alert the system administrator when the partition /dev/hda3 reaches 50% capacity.
  • cutoff[/mountpoint] — Override the defaultCutoff for the mount point. For example, if cutoff['/home'] = 50 is specified, diskcheck will alert the system administrator when the mount point /home reaches 50% capacity.
  • exclude — Specify one or more partitions for diskcheck to ignore. For example, if exclude = "/dev/sda2 /dev/sda4" is specified, diskcheck will not alert the system administrator if /dev/sda2 or /dev/sda4 reaches the specified cutoff percentage.
  • ignore — Specify one or more file system types to ignore in the format -x filesystem-type. For example, if ignore = "-x nfs -x iso9660" is specified, the system administrator will not be alerted about nfs or iso9660 file systems reaching capacity.
  • mailTo — Email address of the system administrator to alert when partitions and mount points reach the specified capacity. For example, if mailTo = "webmaster@example.com" is specified, webmaster@example.com will be emailed alerts.
  • mailFrom — Specify the identity of the email sender. This is useful if the system administrator wants to filter the mail from diskcheck. For example, if mailFrom = "Disk Usage Monitor" is specified, email will be sent to the system administrator with the sender Disk Usage Monitor.
  • mailProg — Specify the mail program to use to send email alerts. For example, if mailProg = "/usr/sbin/sendmail" is specified, Sendmail will be used as the mail program.

No comments: