Check open file limit for a specific process
This is a simple Nagios check bash script for checking the number of open file descriptors a process is using in relation to the soft maximum limit set for the process. This is particularly useful for monitoring mongod processes for numerous databases generated on the fly.
Niko The Dread Pirate (@deathanchor)
Install script into your nagios plugins for use with nagios checks.
usage: ./openFileCheck.sh -c <CRITICAL> -w <WARNING> [ -f <PIDFILE> | -n <PROCESS_NAME> ]
Checks max file limit of process and number of open file handles process is using.
Defaults:
<CRITICAL> = 40 (percentage)
<WARNING> = 50 (percentage)
Either:
-f <pidfile> file that contains the pid to check (preferred)
-n <process name grep pattern> to get pid info (first pid found gets used)