Support Questions
Find answers, ask questions, and share your expertise

How to search a directory for files and send an email notification if no files are present using NiFi?

 
1 ACCEPTED SOLUTION

Master Guru

@NAVEEN KUMAR

One suggestion might be use a ListFile processor configured to run on cron schedule. You could then feed the success from that processor to MonitorActivity processor. The inactive relationship of this processor could be routed to a putEmail processor.

So lets say you have you list file configured to run every 3 minutes based on a cron. You could set your threshold in the MonitorActivity processor to 3 minutes with a setting of "continually send message" set to true. With the inactive relationship routed to putEmail, you will get an email every 3 minutes if the listFile produced no new files.

you could also route the activity.restored relationship to a PutEmail processor if you want to be notified if file where seen following a period of no activity.

10329-screen-shot-2016-12-15-at-82756-am.png

Thanks,

Matt

View solution in original post

2 REPLIES 2

Master Guru

@NAVEEN KUMAR

One suggestion might be use a ListFile processor configured to run on cron schedule. You could then feed the success from that processor to MonitorActivity processor. The inactive relationship of this processor could be routed to a putEmail processor.

So lets say you have you list file configured to run every 3 minutes based on a cron. You could set your threshold in the MonitorActivity processor to 3 minutes with a setting of "continually send message" set to true. With the inactive relationship routed to putEmail, you will get an email every 3 minutes if the listFile produced no new files.

you could also route the activity.restored relationship to a PutEmail processor if you want to be notified if file where seen following a period of no activity.

10329-screen-shot-2016-12-15-at-82756-am.png

Thanks,

Matt

Thanks very much @Matt. It works!!!

; ;