![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| System usage check | pushkar.verma | AIX | 3 | 01-25-2008 02:11 PM |
| CPU usage and memory usage | mansoorulhaq | High Level Programming | 1 | 08-09-2007 04:55 PM |
| how to use ioctl to check out memory usage | lanchen | High Level Programming | 2 | 01-31-2006 01:30 PM |
| Check the Disk usage Programmatically | SriSri | High Level Programming | 2 | 09-20-2005 03:15 AM |
| Monitor CPU usage and Memory Usage | Gajanad Bihani | High Level Programming | 2 | 03-09-2005 07:35 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi!
This might be useful. It would give you procedure to send a mail thru perl.Extracting cpu usage shouldn't be a big deal. Code:
sub _send_email($$$) {
my $recipient = shift;
my $full_name = shift;
my $result_file = shift;
my $res_file = basename($result_file);
my $res_dir = dirname($result_file);
chomp(my $hostname = qx/uname -n/);
my $msg = MIME::Lite->new(
From => '"Manager Usage" <MGR@"Server name">',
To => "\"$full_name\" <$recipient>",
Subject => "Results of usage for $input_dir on $hostname",
Type => 'multipart/mixed',
Data => "The results of your usage run are attached."
);
$msg->attach(
Type => 'TEXT',
Data => "Hello,\n$full_name\n\nPlease DO NOT reply to this email!\n\nIt was generated by a non-user account. Attached is a file\ncontaining the results of your requested deck_check.upl run.\n\nThank You,\nThe HP Issuance Team"
);
$msg->attach(
Type => 'TEXT',
Path => "$result_file",
Filename => "$res_file",
Disposition => 'attachment'
);
$msg->send("sendmail");
}
|
![]() |
| Bookmarks |
| Tags |
| perl, perl shift, shift, shift perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|