Nagios Alerts for Directory Path That Changes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

Nagios Alerts for Directory Path That Changes

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Alerts for Directory Path That Changes

Post 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++...
Be sure to check out our Knowledgebase for helpful articles and solutions!
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

Re: Nagios Alerts for Directory Path That Changes

Post 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?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios Alerts for Directory Path That Changes

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Alerts for Directory Path That Changes

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked