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

Nifi alert when a processor is in stopped state or running state

Explorer

Hello Team,

 

I have a pipeline that starts with an ad-hoc flow file processor as the starting processor. During cluster maintenance, the processors often go to a stopped state. Is there a way, I can get an alert with the note this processor is in a stopped state? Basically, the ask is to send alerts based on the state of the processor.

 

Thanks in advance.

4 REPLIES 4

Master Collaborator

Hi @ep_gunner ,

 

You can use the QueryNiFiReportingTask reporting task to report on the status of any processors, connections, process groups, etc. This reporting task allow you to use a SQL query NiFi status.

 

For example, if you're interested in any stopped processor, you can use the query:

select *
from PROCESSOR_STATUS
where runStatus = 'Stopped'

 

You could also filter that by processor name or id if you need to be more specific:

select *
from PROCESSOR_STATUS
where runStatus = 'Stopped'
  and <YOUR_FILTER>

where YOUR_FILTER could be any of the below:
  id = '<YOUR_PROCESSOR_ID>'
  groupId = '<YOUR_PROCESSOR_GROUP_ID>'
  name = '<YOUR_PROCESSOR_NAME>'
  processorType = '<YOUR_PROCESSOR_TYPE>'

or any combination of the above

 

The results of this reporting task can be forwarded to any available ReportSink in NiFi (Database, Kafka, Email, etc). You can also send the results to a NiFi Input Port using the SiteToSiteReportingRecordSink and them you can process those reports with NiFi itself and take any other action you want.

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Explorer

Thanks for the reply @araujo 

 

I was trying this solution out. The Nifi instance (1.16) I am using doesn't have QueryNifiReportingTask in the reporting task section, so I assume I have to build the nar first & then use it? Is that understanding correct?

Master Collaborator

@ep_gunner ,

 

You can download the NAR from here: https://repo1.maven.org/maven2/org/apache/nifi/nifi-sql-reporting-nar/1.16.0/

Make sure you get the one that matches your NiFi version.

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Rising Star

If you do not mind, you can add MonitorActivity processor to the output end of the processor. This would generate two flow files(inactivity & activity restored) whenever your processor is down. In addition, connect the output end of MonitorActivity processor to PutEmail processor to configure an email Alert that would notify you when the processor is down & when activity has been restored.

I hope this helps.

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