I’m having some issues with a server that goes down in a couple of weeks. All I see from the error logs is the Apache OOM errors. The logs don’t really show what process is causing the system to run out of memory – but here’s what I thought. I have a nagios server monitoring the system. Nagios does send out alerts when the system has high CPU utilization. As next steps – I am planning to have an Event Handler to Nagios that will execute the top command in the event of High CPU Utilization and store the results in a log file.
top -n 1 -b > top.log #-n represents the number of consecutive results to be printed #-b denotes that the output is a batch operation
And if you’re looking for information on the Nagios Event Handling functionality, refer to this URL: http://nagios.sourceforge.net/docs/3_0/eventhandlers.html