Created 10-16-2017 03:56 AM
I am working on a POC and I have installed the NIFI at my laptop, now i am trying to execute the SH script which hosted on Linux machine, could you guide me on step by steps.
Created 10-17-2017 07:55 AM
You can use this processor to run the command through `ssh` command to that linux machine, like explained here.
Created 10-19-2017 06:43 PM
I have a blog post that describes how to use ExecuteScript with Groovy and Sshoogr to execute remote commands via SSH. Not sure if this is what you're looking for but I thought I'd share in case it was useful.
Created 10-23-2017 03:06 AM
@Matt Thanks for the response. I saw your post and its good. My Requirement is, I have some .SH script which hosted on a Linux machine and i wanted to execute those script using the NIFI.
Issues:NIFI ruining at my laptop and I am trying to get the files from Linux machine how i can achive this ?
Created 10-25-2017 07:55 AM
Hi Matt, Do you have any template for that ?
Created 10-23-2017 03:38 AM
Hi Shakeel,
There is a python package called 'paramiko' that can ssh to a remote linux machine. All you need to do is to write the python script on your local windows machine. Give the hostname and other details to the paramiko object. Then you can use Nifi to run the paramiko.py script on local. This in turn will execute your remote .sh script.
Refer this post for reference: https://stackoverflow.com/questions/3635131/paramikos-sshclient-with-sftp''
Approach 2:
Use the ExecuteStream processor. The inputs are as below:
Command Arguments: user@servername;"bash <yourscript.sh> 2>&1"
Command Path: /usr/bin/ssh
This can execute a remote script if the server/computer is reachable from Nifi cluster. That means that your computer should be ping (able) from the Nifi machines.
If there are better solutions, please share.
Created 10-25-2017 07:49 AM
Thanks for the response, do you have template for that ?