Skip to main content
Question

Connect to remote host with SSH


pmcpherson
Contributor
Forum|alt.badge.img+9

I'm interested in using FME to connect to a number of remote hosts to run a few command line commands, and returning the results back to the workflow for further processing. The remote host devices are network elements running an abbreviated version of Linux. Can PythonCaller be used for this purpose? The SSH connection must be completed through an intermediary "jump box". Any ideas will be appreciated.

3 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

I'm not sure if this is helpful but FME has a SystemCaller transformer which lets you run commands from the Command Line. You might indeed be able to use a python caller. If you can have a python script perform the same process outside of FME then you should be able to stick the code it inside of FME. Take advantage of the FeatureReader to read in the results of the external process if you want to bring the data back into FME. A good example of using an external tool to process data can be seen inside the LASTools custom transformers. This doesn't involve SSH to a remote server but might give you help on the other parts of the problem.


jstanger
Forum|alt.badge.img+1
  • July 7, 2020

This can certainly be done using sshtunnel or asyncssh libraries. To get these to work you may need to temporarily modify the Python sys.path to allow you to use the updated version of cryptography that what FME has by default. If you stash the list before you change it, you can restore it after the PythonCaller finishes. If you are running remote bash commands, probably best to keep it all in the one PythonCaller too.


arthur_bazin
Contributor
Forum|alt.badge.img+12
  • Contributor
  • April 26, 2023

Hi,

In the same topic, this idea talk about ssh connexion for database : https://community.safe.com/s/bridea/a0rDm000000D9J0IAK/write-to-remote-mysql-database-through-ssh

 

I've added a comment to include all kind of database, not just MySQL.

You can vote for this idea if you want.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings