Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
sh-compliant script to check a specific process and its cpu/memory utilization (PNP Template included)
Current Version
Last Release Date
June 15, 2009
Owner
Nagios Exchange
Website
http://www.matejunkie.com/
The script (Version 1.0)
The appropriate license
The PNP Template
Description
check_ps.sh is a Nagios plugin to check a specific process via ps. You may provide any string as an argument to match a specific process. Please note that the output could be distorted if the argument matches various processes, so please make sure to use unique strings to match a process. Version
Version 1.0, 2009, Mike Adolphs (http://www.matejunkie.com/) -h/--help Output
check_ps.sh -p firefox -w 10 -c 20 -t cpu
Options:
-p/--process) You need to provide a string for which the ps output is then then greped. -w/--warning) Defines a warning level for a target which is explained below. Default is: off -c/--critical) Defines a critical level for a target which is explained below. Default is: off -t/--target) A target can be defined via -t. Choose between cpu and mem. Default is: mem
Output example
user@host: ~ $ ./check_ps.sh -p firefox OK - Process: firefox, User: user, CPU: 12.4%, RAM: 17.2%, Start: May29, CPU Time: 12907 min | 'cpu'=12.4 'memory'=17.2 'cputime'=12907 user@host: ~ $ ./check_ps.sh -p firefox -w 5 -c 10 CRITICAL - Process: firefox, User: user, CPU: 12.4%, RAM: 17.2%, Start: May29, CPU Time: 12908 min | 'cpu'=12.4 'memory'=17.2 'cputime'=12908 user@host: ~ $ ./check_ps.sh -p firefox -w 5 -c 20 WARNING - Process: firefox, User: user, CPU: 12.4%, RAM: 17.2%, Start: May29, CPU Time: 12909 min | 'cpu'=12.4 'memory'=17.2 'cputime'=12909 user@host: ~ $ ./check_ps.sh -p firefox -w 20 -c 25 OK - Process: firefox, User: user, CPU: 12.4%, RAM: 17.2%, Start: May29, CPU Time: 12909 min | 'cpu'=12.4 'memory'=17.2 'cputime'=12909 ] user@host: ~ $ ./check_ps.sh -p firefox -w 5 -c 10 -t cpu CRITICAL - Process: firefox, User: user, CPU: 12.4%, RAM: 17.2%, Start: May29, CPU Time: 12923 min | 'cpu'=12.4 'memory'=17.2 'cputime'=12923 user@host: ~ $ ./check_ps.sh -p firefox -w 10 -c 5 Please adjust your warning/critical thresholds. The warning must be lower than the critical level! user@host: ~ $ ./check_ps.sh -p firefox -w 10 Please also set a critical value when you want to use warning/critical thresholds! user@host: ~ $ ./check_ps.sh -p firefox -c 10 Please also set a warning value when you want to use warning/critical thresholds! Changelog
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!