Skip to content

Instantly share code, notes, and snippets.

@rushipkar90
Created September 25, 2015 16:42
Show Gist options
  • Save rushipkar90/b84abc81fc163d2c5510 to your computer and use it in GitHub Desktop.
Save rushipkar90/b84abc81fc163d2c5510 to your computer and use it in GitHub Desktop.
usagestatsmail.pl
#!/usr/bin/perl
$stats = `/root/sysutils/usagestats.sh`;
chomp($hostname = `hostname`);
chomp($date = `date +%m/%d/%Y`);
open (OUT, "|/usr/sbin/sendmail -t");
print OUT "From: nobody\@$hostname\n";
print OUT "To: sysadmin\@hostpapasupport.com\n";
print OUT "Subject: $hostname: Usage Stats for $date\n\n";
print OUT $stats;
close (OUT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment