Anonymous
public text v1 · immutablemy @results = `ps auxww | grep httpd | grep -v root | awk '{print \$2,\$3,\$4}'`;
foreach $line (@results) {
chomp $line;
#print "$line\n";
my ($pid, $c_usage, $m_usage) = split / /, $line;
if ($c_usage > 40 || $m_usage > 30) {
print "WARNING: $pid using cpu: $c_usage% memory: $m_usage%\n";
}
}