Linux

check_proc_files

Description:

Linux perl script reports max_files (soft) utilization percentage for a given process

Current Version

1.1

Last Release Date

2012-09-16

Compatible With

  • Nagios 3.x

Owner

Ted


Project Files
Project Notes
check_proc_files is a perl script to report the file handle utilization for a given process as a percentage of max_files. The basic functionality is accomplished by matching a string to a process command (and optionally user) and counting the number of files listed under /proc/$PID/fd. Because /proc/*/fd is a Linux specific feature this script functions only on Linux systems. Because /proc/*/fd is owned by the process user it is necessary for this script to run using setuid. Perl helps address the security issues here. There are no calls to external shells or apps. The only file access done is for read only. There are no prompts for user input. Usage The script requires a string to match to a process to check. It processes the first match so the string should be as specific as possible. It uses the process command found under /proc/*/cmdline in order to match a process (this is done to avoid using ps which requires an external call). The command stored there includes the entire command line of the process including all parameters, but any spaces there are replaced by NULL. The script makes an attempt to compensate for this by removing any spaces from the match string supplied, but thismay not always work. It is best to avoid using spaces in the matching string. In order to assist with matching the process the script also accepts a user name and matches only processed owned by that user. The only other command line parameters are -c and -w for the warning and critical levels. Output file handle utilization is the percentage of the soft file limit in use by open files.
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
51,413