[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cobalt-users] OT Shell/Perl Script
- Subject: [cobalt-users] OT Shell/Perl Script
- From: "Todd W" <twooly@xxxxxxxxx>
- Date: Tue Feb 25 18:51:01 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
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
#!/usr/bin/perl
$cputemp=`cat /proc/cpuinfo | grep temperature | cut -b 15,16,17,18`;
$uptime = `/usr/bin/uptime`;
$disk = `df -h`;
$mem= `cat /proc/meminfo`;
$proc = `ps auxc | wc -l`;
$proc =~ /(\d+)/;
$procnum = $proc - 3;
$netstat = `netstat`;
$netstat3 = `netstat -l`;
$netstat2 = `netstat --statistics`;
print $uptime;
print "\n";
print 'Number of Processes ';
print $procnum;
print "\n";
print "\n";
print 'CPU Temp ';
print $cputemp;
print "\n";
print $mem;
print "\n";
print "\n";
print $disk;
print "\n";
print "\n";
print $netstat;
print "\n";
print "\n";
print $netstat2;
print "\n";
print "\n";
print $netstat3;
print "\n";
print "\n";