[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] OT Shell/Perl Script
- Subject: Re: [cobalt-users] OT Shell/Perl Script
- From: "William J.A. Brillinger" <billy@xxxxxxxxxx>
- Date: Tue Feb 25 18:57:01 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
At 08:50 PM 25/02/03 -0600, you wrote:
I am trying to setup and shell/perl script that will email me the state my
server is in and was wandering if some could help. Basicly I have the perl
script done but I am unsure how I can get the output mailed to me. Here is
the script
an idea for you...
#!/usr/bin/perl
#$topoutput = `/usr/bin/top -b -n1`;
$topoutput = `cat /proc/meminfo`;
open (MAIL,"|/usr/sbin/sendmail -t");
print MAIL "From: admin\@secure1.pdcweb.net\n";
print MAIL "To: admin\@pdcweb.net\n";
print MAIL "Subject: SECURE1 Hourly MEM Report\n\n";
print MAIL "$topoutput\n\n";
close (MAIL);
---------------------------------
William J.A. Brillinger
Precision Design Co.
E-Mail: mailto:billy@xxxxxxxxxx
Web site: http://www.pdcweb.net