Page 1 of 1
Nagios Alerts for Directory Path That Changes
Posted: Fri Oct 10, 2014 9:01 am
by pfsweb
hello,
Currently in the process of migrating from another application to NagiosXi monitoring. I have alerts in this application that monitor a directory like \\Server\folder\YYYY_MM_DD where the folder name changes everyday based on the current date. Is there a monitor with this capability in NagiosXi? I was thinking there may be a way to manipulate the folder watch wizard to get the job done but haven't found anything as of yet. Any suggestions?
thanks
Re: Nagios Alerts for Directory Path That Changes
Posted: Fri Oct 10, 2014 11:24 am
by lmiltchev
This folder would be on a Windows box, correct? What exactly are you trying to monitor - number of files, age, size, patterns, etc.? BTW, the folder watch wizard is not officially released, and as of now it can be used only on Linux. Perhaps you could use a custom script and call it with NCPA or NSClient++...
Re: Nagios Alerts for Directory Path That Changes
Posted: Fri Oct 10, 2014 11:39 am
by pfsweb
We want to make sure that example.file exists in the folder at a certain time.
The folders are on a linux box but the folder is mounted on an AIX box, could we monitor via that mount?
Re: Nagios Alerts for Directory Path That Changes
Posted: Fri Oct 10, 2014 4:18 pm
by sreinhardt
So essentially it will be a check on the linux system, checking mounted files from the aix system. Shouldn't be too hard. I would suggest checking out
http://exchange.nagios.org/directory/Pl ... ck/details as a folder check plugin. I would suggest trying that plugin with something like:
./check_fileage.py -f "/mnt/aix/$(date +"%Y_%m_%d)/file" -w 720 -c 1440
This should allow you to both make sure that the file is not less than a day old and with the command substitution, should format and output the date properly. Now if you wanted to check the remote share without it already mounted, we might have to look into something else.
Re: Nagios Alerts for Directory Path That Changes
Posted: Fri Oct 10, 2014 4:24 pm
by lmiltchev
There are various plugins on the Nagios Exchange that may do the job for you.
http://exchange.nagios.org/index.php?op ... e%20exists
You may need to test them from the CLI first. If they work - you can set up your check, following the steps, outlined in this document:
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
If you cannot find anything that would check the existence of a remote file, you could probably use a custom script and NRPE.