Home Directory Plugins Reporting check_file_numbers

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

check_file_numbers

Current Version
0.2
Last Release Date
2012-05-16
Compatible With
  • Nagios 3.x
  • Nagios XI
License
GPL
Hits
7984
Files:
FileDescription
check_file_numbers.plThe perl script
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This will total up fles on specific directory paths that match a certain wildcard pattern e.g. how many pdf files are in a particular area. Can be used as a test that various housekeeping functions are not letting e.g. log files build up.

This has the potential to be very IO intensive so do not schedule this to run too often!
Nagios plugin to check numbers of a file matching a pattern
Either works by applying the supplied file globs directly - in which case the glob could be anchored as an absolute path e.g. /tmp/*.xml

Or if the optional -b for basedir is given we do a File::Find tree walk from that base and for each sub directory the specified file globs are applied.

In this case it is an error for any of the globs to be an absolute path. This has to be checked for in a portable way so that the code will work for Windows as well as Unix - the way we choose to do this is to insist that the glob cannot have any directory name component - i.e. that it must equal its own basename.

Beware that this plugin has the potential to be expensive on disk IO so take care with how regularly it is scheduled!