Nagios plugin for monitoring files in a directory?

Israel Brewster israel at frontierflying.com
Fri Jul 10 22:42:10 CEST 2009




On Jul 10, 2009, at 8:16 AM, David Rosenstrauch wrote:

> Just wondering if anyone might have some pointers on a monitoring  
> puzzle
> I've run into.
>
> We have a couple of automated processes - one of them an automated FTP
> upload, the other an automated log file gatherer - which wind up  
> causing
> essentially the same result:  new files regularly getting added to a
> disk directory.  I need to set up monitoring on this, since if we're  
> not
> getting new files showing up then something has crashed and our system
> won't be getting updated properly.
>
> Not quite sure how to do this, though - i.e., which nagios plugin  
> would
> help me get the job done.
>
> I've used the check_file_age plugin successfully in a couple of spots.
> E.g., to verify that a backup process has been run successfully I
> perform a unix "touch" on a "last-backup-date" file at the end of the
> backup, and then have the check_file_age plugin check the age of that
> file.  I don't think I can use that plugin & technique here,  
> however, since:
>
> a) Each uploaded file has a different (timestamped) name, which I  
> don't
> know ahead of time.  So I have no way to tell the check_file_age  
> plugin
> which file to monitor.
>
> b) Unlike my backup process, which I wrote and was able to alter to
> touch the last-backup-date file, I don't have control over the  
> external
> processes creating/uploading these files.
>
>
> I saw there were some rudimentary directory-monitoring plugins over at
> the Monitoring Exchange site, but they seem like they can only do  
> things
> like monitor the number of files in a directory vs. a threshold  
> minimum,
> which is not quite what I want.  (I don't really care about how many
> files there are in the directory.)
>
>
> Anyone have any suggestions on an existing plugin (either part of the
> standard Nagios release, or available from Monitoring Exchange) that  
> can
> help here?  I'm not afraid to roll my own plugin if needed, but I'd
> obviously prefer to save myself some work and use an existing one if
> possible.

How about using check_file_age on the directory itself? I think the  
timestamp of the directory is updated whenever a new file is added. Or  
are there other processes going in in the directory, such as deletions  
or modifications, that might make this value unreliable?

-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
>
> Thanks,
>
> DR
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited  
> time,
> vendors submitting new applications to BlackBerry App World(TM) will  
> have
> the opportunity to enter the BlackBerry Developer Challenge. See  
> full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when  
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Israel Brewster.vcf
Type: text/directory
Size: 397 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090710/44f2f2ba/attachment.bin>
-------------- next part --------------
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list