Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_top_process

Rating
2 votes
Favoured:
0
Hits
146264
Files:
FileDescription
check_top_process.shcheck_top_process
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Checks the top running process on the system. Has arguments for warning and critical levels.
You are forewarned about my coding skills.

Basically, runs ps and finds the process with the highest cpu percentage. Default is to warn above 50% and critical above 80%, but these values can be changed using standard -w and -c syntax (I hope). Works on Linux, probably works other places, uses ps awk standard shell stuff.

Why would you want this? In my case, certain systems will runaway processes spike above a certain percentage cpu usage. If any process runs above a specific mark, I\'m pretty sure I have a runaway process. I can then go kill it before it causes other problems.

Feel free to use or modify the code. It is very simple, but may make a good template or help out someone trying to figure out scripting in nagios.

BTW, I use it through NRPE.
Reviews (1)
byxoroz, April 24, 2012
It was a nice idea it works allright.

Had to to convert to unix format using
dos2unix check_top_process.sh

thanks for this script