Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Nifi : Alert mail to be sent when file not found in folder

Contributor

Nifi : Alert mail to be sent when file not found in folder

Is there a way using Nifi to poll a particular folder for a file .

If file not found in that interval ,send a mail .

Get File allows read a file ,but there is not failure relationship when using getFile processor.

How can that be achieved ?

1 ACCEPTED SOLUTION

Expert Contributor

Template attached. I am using Nifi 1.3.0. In this template if a file is not found in GetFile processor every 10 seconds an event will be generated. You can put an email processor in front of Monitor Activity to send mail. You can also set custom subject headers in Monitoring processor (also in the template).

42528-nmont.jpg

nifimonitoring.xml

View solution in original post

4 REPLIES 4

Expert Contributor

Put a MonitorActivity processor after your GetFile processor. Set the threshold to your interval. If a file is not found in that interval MonitorActivity will be triggered.

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.4.0/org.apache...

Contributor

@Umair Khan Could share a sample template consisting of monitor activity processor to handled this scenario. Not able to understand the way to use it. Thanks

Expert Contributor

Template attached. I am using Nifi 1.3.0. In this template if a file is not found in GetFile processor every 10 seconds an event will be generated. You can put an email processor in front of Monitor Activity to send mail. You can also set custom subject headers in Monitoring processor (also in the template).

42528-nmont.jpg

nifimonitoring.xml

Contributor

@Umair Khan

Thanks for the template . Have another question ,suppose i have a threshold interval of 10 min but would like monitor only twice (10 min + 10 min)and not every 10 min ,how can that be done?

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.