I have written a couple more Nagios plugins for use with NRPE on linux machines. The first one, “check_cpu.sh ,” grabs the cpu state from “/proc/stats” and sends back a status result and perfdata. You can tell it to send back either the aggregate data from all cpus as a single total or can have it return all cpus individually. Be aware though, that if you wish to have it send data on all cpu’s you will need to patch Nagios to allow for a larger perfdata return buffer. I didn’t want to mess with doing that, so I just have it watch the aggregate data.
The second plugin, “check_mem.sh,” will parse the output of “free -mt” to give you a look at the current memory and swap utilization.