Created
September 25, 2015 16:42
-
-
Save rushipkar90/b84abc81fc163d2c5510 to your computer and use it in GitHub Desktop.
usagestatsmail.pl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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