Hello,
I have an issue which I could use some advice on. Sometimes one of our servers has issues with sendmail and e-mails get "hung" and we have to kill them manually. In order to automate the whole process we are calling Proc:ProcessTables and then trying to kill a process that has been up for longer than one hour.
However.. the question is.. how do we tell the script to kill the perl client instead of killing off the daemon?
Code:
if (($p->fname eq "sendmail")&&($p->time > 3600000000)) {
$logpid = $p->pid;
#print "$logpid needs to be killed\n";
system("echo \"killing sendmail $logpid on `uname -n` at `date`\" | mail ourcompany\@ourcompany.com -s \"`uname -n`: killed sendmail\"");
system(mail ourcompany@ourcompany.com -s \"`uname -n`: Long running sendmail process detected\""));
$p->kill(1);
Any help would be greatly appreciated!