apacheapache-nifiapache-minifi

How to get the flowStatus on a Windows Apache Minifi Installation


The answer is NO - but the Apache Team is looking in developing this functionality as per @apiri answer below.

I have a Apache NiFi Server i use to collect data from multiple source (Windows/Linux) where i have minifi on them setup.

On each edge minifi flow configuration i have a self-control PG that collect minifi internal statistics such as instance:health,stats,bulletins.

Where the call look like this

Eg

#/bin/bash
/opt/minifi/bin/minifi.sh flowStatus instance:health,stats,bulletins  | tail -2 | head -1

So far so good - i get this data extract the json -> create an Influx Call and push it into a InfluxDb that is then displayed into Grafana, this has alerts when one Egde goes off or there is a high queue, or even the Garbage Collector on the minifi edge stats bla bla.

Question:

How do i do this in Windowzzzzz ? i am going crazy.

The .bat executables are not responding to any of the flowStatus options

I managed to do it thru Cygwin but i don`t want to setup Cygwin in all egdes.

Any ideas here on how i can achieve this ?

thanks

Here is small demo of what i am trying to do:

All the actions are done on a Windows Server

Working - this is done from MobaXterm client installed on the Windows Server. ā”€

[2018-01-24 11:50.51]  /drives/d/minifi/bin
[adrian.oprea.PRODMSTR06] āž¤ ./minifi.sh flowStatus connection:all:health,stats | tail -2 | head -1
{"controllerServiceStatusList":null,"processorStatusList":null,"connectionStatusList":[{"name":"OUT Run Script/Extract//2e326e86-0160-1000-7b13-90d03f15b46e","connectionHealth":{"queuedCount":0,"queuedBytes":0},"connectionStats":{"inputCount":30,"inputBytes":2996,"outputCount":30,"outputBytes":2996}},{"name":"OUT Generate Scripts//IN Run Script/Extract","connectionHealth":{"queuedCount":0,"queuedBytes":0},"connectionStats":{"inputCount":10,"inputBytes":12360,"outputCount":10,"outputBytes":12360}}],"remoteProcessGroupStatusList":null,"instanceStatus":null,"systemDiagnosticsStatus":null,"reportingTaskStatusList":null,"errorsGeneratingReport":[]}

Not Working - this is done using PowerShell as Administrator and making use of the run-minifi.bat

    PS D:\minifi\bin> ls


    Directory: D:\minifi\bin


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        12/12/2017  11:47 AM       1939 dump-minifi.bat
-a---        12/12/2017  11:47 AM       1130 minifi-env.bat
-a---        12/12/2017  11:47 AM       1120 minifi-env.sh
-a---        12/12/2017  11:47 AM      10999 minifi.sh
-a---        12/12/2017  11:47 AM       1938 run-minifi.bat
-a---        12/12/2017  11:47 AM       1909 status-minifi.bat


PS D:\minifi\bin> .\run-minifi.bat  flowStatus connection:all:health,stats
The JAVA_HOME environment variable is not defined correctly.
Instead the PATH will be used to find the java executable.

2018-01-24 11:54:55,117 INFO [main] org.apache.nifi.minifi.bootstrap.Command Apache MiNiFi is already running, listening
 to Bootstrap on port 49227
2018-01-24 11:54:55,120 INFO [main] org.apache.nifi.minifi.bootstrap.Command Start method returned null, ending start co
mmand.
PS D:\minifi\bin>

Solution

  • This was certainly an oversight on our behalf and we do not have explicit support for invoking the flowStatus from one of the bat files.

    I have created an issue to make sure this gets addressed for our next release, located at https://issues.apache.org/jira/browse/MINIFI-430.

    The workaround in the interim, also listed in the ticket:

    The current workaround would be to edit/duplicate one of the bat files and modify the BOOTSTRAP_ACTION to be flowStatus and support handling additional arguments. For example, this line in run-minifi.bat (https://github.com/apache/nifi-minifi/blob/e9e9179f8d359bc30aa61c60f5a35441bfb7513a/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-resources/src/main/resources/bin/run-minifi.bat#L48)

    Thanks for bringing this to our attention.

    Update: This has been incorporated into the master branch of the repo (https://github.com/apache/nifi-minifi/commit/a08bc9a23e7274fce18ae4e281e1105d97962f99) and will be available with the 0.5.0 release.