Home Directory Plugins Operating Systems Linux CheckFileCountWithPerf

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

CheckFileCountWithPerf

Current Version
1.0
Last Release Date
2011-12-27
Compatible With
  • Nagios 3.x
  • Nagios XI
License
GPL
Hits
132521
Files:
FileDescription
check_numoffiles.shcheck_numoffiles.sh
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This is identical to the original CheckFileCount done by Bernd Mueller. I've just updated it to include performance data as well for graphing by external programs. I also did a simple change that added the checked directory in the status text.
Plugin for Nagios to monitor how many files a directory contain

Written by Bernd Mueller (http://www.lisega.de/)

Change History
2011/12/27 -- Added perf data for graphing
- Mike Clark, Masergy Communications, Inc (www.masergy.com)

You are free to use this script under the terms of the Gnu Public License.
No guarantee - use at your own risc.

Usage: ./check_nomoffiles -d -w -c

Description:

This plugin determines the number of files in a directory
and compares it with the supplied thresholds.

Output:

The plugin prints the Count of Files in the directory followed by "ok" or either "warning" or "critical" if the corresponing threshold is reached.

Exit Codes
0 OK Directory Count of files checked and everything is ok
1 Warning Directory Count of files above "warning" threshold
2 Critical Directory Count of files above "critical" threshold
3 Unknown Invalid command line arguments or could not determine directory size

Example: check_numoffiles -d . -w 1000 -c 1400

121 Files in . - ok|files=121;1000;1400 (exit code 0)
1234 Files in . - warning|files=1234;1000;1400 (exit code 1)
1633 Files in . - critical|files=1633;1000;1400 (exit code 2)