Establishing SSH Connection from Ignition and executing commands & Python

To run python externally, you need no libraries locally. You need them wherever python will run.

In Ignition, I would use java’s normal classes (starting with ProcessBuilder) to spawn your platform’s ssh executable with suitable parameters (to connect to the remote system and launch your script), with a stream attached to the process’ stdout. Parse/decode that stream to get your result.

Use SSH keys to avoid any prompts while connecting. I recommend arranging for the selected key to only allow running the target script. (A limitation applied to the corresponding line of authorized_keys in the remote system.)

1 Like