\\\d+/ ) {
if ( $nline =~ m/\d+\-\d+\<[^\>]*\>\<[^\>]*\>(\d+)/ ) {
my $pid = $1;
$nline = ;
$nline = ;
if ( $nline =~ m/^\]*\>\]*\>[\d+\.]*\<[^\>]*\><[^\>]*\><[^\>]*\>([^\<]*)\<[^\>]*\>\<[^\>]*\>\<[^\>]*\>([^\<]*)/ ) {
my $vhost = $1;
my $req = $2;
my $url = ( split( /\s/, $req, 3 ) )[1];
my $user;
if ( $url && $url =~ m/^\/~([^\/]*)/ ) {
$user = $1;
}
else {
$user = Cpanel::AcctUtils::DomainOwner::Tiny::getdomainowner($vhost);
}
if ($user) {
$HTTPPIDS{$pid} = 1;
$HTTPVHOSTS{$pid} = $vhost;
$HTTPURL{$pid} = $url;
$HTTPOWNER{$pid} = $user;
}
}
}
}
}
alarm(0);
};
alarm(0);
shutdown( WHMS, 2 );
close(WHMS);
my @PROCS = Cpanel::SafeRun::Simple::saferun( 'ps', 'axo', 'user,pid,ppid,command' );
foreach (@PROCS) {
my ( $user, $pid, $ppid, $cmd ) = split( /\s+/, $_ );
if ( $cmd =~ m/exim/ || $cmd =~ m/mail/ ) {
$PCOUNT{ $HTTPOWNER{$ppid} }++;
if ( $HTTPPIDS{$ppid} == 1 && $PCOUNT{ $HTTPOWNER{$ppid} } > 6 ) {
print "Pid $ppid is mailing using [$cmd]..\n";
print "Host: $HTTPVHOSTS{$ppid}\n";
print "Url: $HTTPURL{$ppid}\n";
print "User: $HTTPOWNER{$ppid}\n\n";
}
}
}
| |