Since I know nothing of your existing Code (I guess there isn't one) I can only give you general advice:
paramiko SSH client is solid to connect via SSH
exec_command: To run stuff on your remote machine/server
Call the Method via Errorhandling. So if stuff breaks catch it and run your method.
check if you have the permissions to run stuff on the machine
logging and integrating to the DAG may be good practice aswell depending on the case Consider Retries if they fit your case