WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Alert when no files arrive (Read 4663 times)
shepy
YaBB Newbies
*
Offline



Posts: 4
UK
Alert when no files arrive
Jan 21st, 2010 at 11:06am
 
Hello,

Is there a way that you can monitor a folder (incl sub folders) and if nothing arrives on any given day a notification can be sent out by email.

I realise that this probably goes against the concept of what WatchDir is all about but we have customers who send us files daily and if for some reason WatchDIr or our process does not pick up the file and load it into the database then we miss the event.

Many Thanks in advance
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: Alert when no files arrive
Reply #1 - Jan 21st, 2010 at 12:30pm
 
Hi,

You are right, this isn't something WD is designed to do. However, here is an idea.

Setup a new task using the email plugin. This task will send you an email when there have been no files for X seconds (3600 for 1 hour).
Make sure the message-body contains something like

Code:
MESSAGE REASON: %WD_REASON% 


probably near the bottom of the message.

The %WD_REASON% will be replaced by WD by the reason of the message (FILENEW for a new file, QUIET when nothing has happened).
Setup the Events window ( http://www.watchdirectory.net/wdhelp/help/wdnewconfigpage4.html ) so it fires for FILENEW and QUIET (you really need both). Set the proper QUIET interval.

When configured like this, you will receive an email for new files and when "nothing happened" during the quiet interval.
If you don't want to have the emails for new files you still MUST enable the FILENEW option. This is because QUIET needs some other event to "compare against".

Now the reason for the
Code:
MESSAGE REASON: %WD_REASON% 


line at the bottom of the message. If you do not want to receive those messages for new files, you can tell the System.Mail process (wdPostman) to ignore them.
Open the menu "View -> Email -> Email Settings" and press the "Filter Email" button.
Add
MESSAGE REASON: FILENEW
as a "message body filter".

From now on, the System.Mail process will silently ignore emails with that text inside the message body.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: Alert when no files arrive
Reply #2 - Jan 21st, 2010 at 12:45pm
 
One more thought....

If you (ever) want to do something like this for multiple tasks, the "MESSAGE REASON" setting is global, for ALL tasks.

Perhaps it is better to change it to
Code:
MESSAGE REASON: %WD_CONFIG%:%WD_REASON% 


%WD_CONFIG% is replaced by the name of your task, see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html

That way, this "filter" only has effect on this task.
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
shepy
YaBB Newbies
*
Offline



Posts: 4
UK
Re: Alert when no files arrive
Reply #3 - Feb 3rd, 2010 at 2:22pm
 
Hello Gert,

Apologies, not got back to you sooner everything works fine.

Thanks for your assistance as always first class

Regards
Paul
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: Alert when no files arrive
Reply #4 - Feb 5th, 2010 at 9:11am
 
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
montgomery_oh
YaBB Newbies
*
Offline



Posts: 4
Re: Alert when no files arrive
Reply #5 - Aug 28th, 2012 at 5:47pm
 
I followed your instructions on the blog post and it works great when you always receive a file every XXX of seconds.  

Now, I would like to create similar alerts allowing for exceptions around certain days or times:

Example 1: I receive a file every 24 hours (+/- few minutes depending on ftp/size/etc) on Monday-Friday only.  Can the "Scheduler" in (Pro) be configured to only monitor/alert on M-F if I don't receive a file?  I have setup "Events" with "FileNew" and "Quiet" (90000) and Scheduler set to "Start task immediately" which alerts me on Sat & Sun.  I have tried different combinations of "Only run tasks on these days" and "Events outside these periods are ignored" but I can't seem to get the right combination.  

Example 2: I receive a file every 30 minutes (+/- few minutes depending on ftp/size/etc) every day.  However, I don't receive files while they perform backups (2am, 2:30am, 3am, 3:30am) and don't want to alert during that time frame.  I setup the alert to notify if I don't receive a file within an hour (3600 secs).  I set Scheduler to run between 00:00 - 01:45 and 03:45 - 23:59 with "Events outside these periods are ignored" checked.  I receive an alert at 2:18am & 4:45am even though I received files at 1:33am and 4:03am).

Can you provide some additional instruction for these scenarios above?

Also, does "Merge tasks" or "When Merging" apply when the Events "FileNew" & "Quiet" options are the only ones checked?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: Alert when no files arrive
Reply #6 - Aug 29th, 2012 at 6:52am
 
Are you running the latest (4.6.7) version - free upgrade? It was released earlier this month and has a bugfix that is related:
http://www.watchdirectory.net/wdhelp/help/wdcc_version_history.html

Improved: When using the Scheduler, QUIET events were not handled properly.


About your settings for this task, see the attached picture.
Assuming you expect the file to arrive a bit after 6am every day, make the scheduled period long enough for the file to be detected AND the QUIET event to fire: do not set it to 90000 (25 hrs) but to just under 1 hour (3550 seconds). Make sure "events outside these periods are ignored" is selected.

Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1