Python/Java Library for SSH from Ignition to SSH server computer to run a script

Working on the an application where when I press a button on Ignition, I need the the action to establish a SSH connection to the remote server and run a python script and also get a return value.

ParaMiko is a python library and has a lot of Dependencies which I am assuming wont work in Jython [ I haven’t tried it]

Wanted to get some guidance on what would be the best option to execute this application ?
Are there any other libraries in python I could use since I am not a java programmer ?

Well… you could write your Python application entirely stand alone, and then either system.util.execute (or one of the alternatives from Java or Python stdlib) or expose a web service endpoint on localhost that you trigger via an HTTP call from Ignition.

Ended up using the system.util.execute to ssh tunnel through a shell script and execute the py shell along with the py script on the remote computer.
system.util.execute - doesn’t have a return value if the script was successfully executed or not, looking into alternate methods to find a work around.

Both the Java and Python stdlib alternatives do return status and output.

See Procedure for installing python libraries from source - #18 by Kevin.Herron for an example.

also https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Process.html#exitValue()

1 Like

Pssst! Use the Java Process library.