#!/usr/bin/perl use strict; use warnings; use Filesys::Df; use MIME::Lite; my $disk_info = df("/"); my $threshold = 90; my $disk_percent; if (defined($disk_info)){ my $disk_percent = $disk_info->{per}; } if ($disk_percent > $threshold) { my $message = MIME::Lite->new ( From =>'diskwatcher@yourcomputer.com', To =>'fixitguy@othercomputer.com', Cc =>'someonewhocares@somedomain.com', Subject =>'ALERT: Im in ur disk usin ur inodes!', Data => "It appears that the disk use threshold is approaching the limit defined in your helpful script. You currently have $disk_percent percent used. Perhaps you should check on this." ); $message -> send ; }