use Win32::Process::List; use Mail::Sender; use MIME::Lite; use strict; my $numloops=0; my $timer=6000; while($numloops>30){ $numloops++ sleep $timer; my $P = Win32::Process::List->new(); if($P->IsError == 1) { print "an error occured: " . $P->GetErrorText . "\n"; } my %list = $P->GetProcesses(); my $anz = scalar keys %list; print "Anzal im Array= $anz\n"; my $count = 0; foreach my $key (keys %list) { # $list{$key} is now the process name and $key is the PID #print sprintf("%20s has PID %10s", $list{$key}, $key) . "\n"; $count++; } print "Number of processes: $count\n"; my $process = "mmdrv.exe"; my %hPIDS = $P->GetProcessPid($process); print keys (%hPIDS) . "\n"; if(%hPIDS) { foreach (keys %hPIDS) { print "$_ has PID " . $hPIDS{$_} . "\n"; } } else { print "Process(s) not found\n"; #exit; my $test= MIME::Lite->send('smtp', "servername@mydomain.com", AuthUser=>"$username",AuthPass=>"$Pass" ); my $msg = MIME::Lite->new( From =>'validemail@mydomain.com', To =>'validemail@mydomain.com', Cc =>'some@other.com, some@more.com', Subject =>'Hello testing email from perl heartbeat monitor script', Data =>"Loadrunner is running!" ); } }