Question

Connect to remote host with SSH

  • 24 August 2018
  • 3 replies
  • 37 views

Badge +8

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

Userlevel 4
Badge +26

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.

Badge +1

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.

Badge +1

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.

Reply