CPU Usage and Load

Check Unix Process

Description:

This Unix perl script checks if a process is running and its CPU, Memory, RSS or VSZ (or all of the above) if selects processes and their children and aggregates the data. It can find the process by name, arguments or by reading a .pid file. The script supports custom return messages, performance data and is event handler friendly.

Check the GitHub link for the latest versions

Current Version

1.4

Last Release Date

2014-12-01

Compatible With

  • Nagios 3.x
  • Nagios 4.x

Owner

License

GPL


Project Files
Project Notes
::Process Resource Usage Check Instructions:: -h|help, Display this help information -C|Check, Specify a check type: PCPU(%), ICPU(%), ACPU(%), Memory(%), VSZ, RSS, IO, stats PCPU uses the ps command. ICPU uses top with a 1 second sample rather than using the average from ps. ACPU uses the files under /proc/ to get the average CPU since the last check run. IO uses the files under /proc/ to get the average disk/cache IO since last run. Note: The ACPU and IO options only works with a PID file (see below) stats will report CPU,Memory, VSZ and RSS by default It will only alert if the process is not running ***These options only work is you are checking via a .pid file*** -nochildren Do not include children in the data collected. -diskio, Add disk IO information to stats check -average_cpu, Add average cpu (ACPU) information to stats check ***These options are for the stats and ACPU checks only*** -multicpu, Use CPU values like that of top and ps rather than true percantages With this option the max cpu usage is 100% * number of logical cores Without this option max cpu usage is 100% ***The following options only work for the CPU and memory checks*** -w|warning, Specify a warning level for the check The default is 60 percent or 1000000 kilobytes -c|critical, Specify a critical level for the check The default is 70 percent or 2000000 kilobytes -M|message, Specify a message to return on failure -R|startup, The script to use to restart the process If selected this will be added the the output on CRITICAL This is an easy way to pass information to an Event Handler ***Highly reccomended that you use this*** -N|name, Specify a differnet name for the process This is for display in Nagios messages Example: check_process.sh -P /var/run/mysqld.pid -N MasterDB The mysqld process will be monitored and the Nagios message will read: The MasterDB process is currently OK. ***Only use one of the following*** -p|processname, Specify a process name to be monitored -a|argument, Specify a process with the following argument in the command line to be monitored -P|PID, Specify a PID file containg the PID to be monitored ***Note: Checks by PID file include all children (by default), but not grandchildren***
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
0 (0)
Favorites
0
Views
43,506