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.
@Marco, thanks for the Answre, But from my local windows machine how i can execute the SSH command. what i am trying to do from my local machine i wanted to execute this command
#!/bin/sh passwrod="Test@Test123" ssh ahmadshe:$firstname.lastname@example.org /opt/batchapps/dsas/Jobs/LOAD_ASSURENET_DATA_INTO_DSAS/test.sh
and the test.sh will execute on Linux Remote machine
#!/bin/sh echo "Test Command Execution" >> /opt/batchapps/dsas/Jobs/LOAD_ASSURENET_DATA_INTO_DSAS/text.txt
could you guide me how i can do
@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 ?
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''
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.