Does anyone know of a way from the command line to find out what specific apache process is doing?
This needs to be something that could work in an automated way.
Background: We sometimes have certain apache processes go out of control and consume too much CPU. The reason for this varies. Sometimes its users trying to write their PHP or Perl scripts or run some other process and some times its outside "attacks". For example, today we had to block a japanese robot that was written by a comp-sci class because it was attempting to index every day, of every month of every year of a users entire events calender. It was at the year 2015 and climbing before we stopped it.
At the moment I can use top or ps to find out which process ID is causing the load and then view apache's /server-status/ to see which page requests are causing the issue. This is great except its a manual process and I can't always get to the console in time to identify the culprit.
Anyone have any suggestions for a little bash script that could do this auto-magically?