I have a Debian server where some processes going rogue from time to time and start consuming too much memory. How I could monitor this at process level so I can set an alarm? Currently I monitor when the server starts using too much memory but I would like to monitor the process individually.
This is how I monitor the total RAM used by apache:
Use Nagios and it's "check_procs" plugin with the RSS-metric parameter:
Alter w & c to fit your warning- and critical-levels for the misbehaving process.
To see the current RSS use this one-liner and check the proc its RSS in the third column: