1

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>
Up_One
  • 5,213
  • 3
  • 33
  • 65
  • 1
    The `minifi.bat` file is located [here](https://github.com/apache/nifi-minifi/blob/35dfa690cbbf6ae3831eb1802e476b2450f8b2b6/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-resources/src/main/resources/bin/status-minifi.bat). Can you please provide the actual shell commands you are running and the output (both the failures in Windows and the successful version in Cygwin)? – Andy Jan 24 '18 at 00:44
  • Hi @Andy - i have just updated my question. – Up_One Jan 24 '18 at 01:06

2 Answers2

2

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.

apiri
  • 1,635
  • 9
  • 15
  • Hi, @apiri that would be great - the funny part is i can still run but using a cygwin client type :) – Up_One Jan 24 '18 at 23:55
  • i guess the answer is NO at this point in time - il mark you answer as correct. – Up_One Jan 24 '18 at 23:56
  • 1
    That would be correct, for now, out of the box. Will certainly look to resolve this for our next release. – apiri Jan 25 '18 at 15:21
1

I believe the issue is that you are invoking run-minifi.bat rather than status-minifi.bat. The run-minifi.bat tool is used to start/stop Apache MiNiFi.

Andy
  • 13,916
  • 1
  • 36
  • 78
  • none of the .bat executable have any output when provided with the flowStatus option - and also i cannot fine any reference on this in the docs – Up_One Jan 24 '18 at 01:21
  • I don't have a Windows instance to test this right now. However, you can see the difference in the `BOOTSTRAP_ACTION` variable -- in `run-minifi.bat` it is set to `run`, and in `status-minifi.bat` it is set to `status`. What is the output if you run `PS D:\minifi\bin> .\status-minifi.bat flowStatus connection:all:health,stats` or `PS D:\minifi\bin> .\status-minifi.bat connection:all:health,stats`? – Andy Jan 24 '18 at 01:26
  • I just get that minifi is running -PS C:\Users\ao\Desktop\Personal\minifijava\minifi-0.4.0-bin\minifi-0.4.0\bin> .\status-minifi.bat flowStatus connection:all:health,stats 2018-01-24 12:35:28,107 INFO [main] org.apache.nifi.minifi.bootstrap.Command Apache MiNiFi is currently running, listening to Bootstrap on port 62665, PID=unknown – Up_One Jan 24 '18 at 01:37