I've created a simple monitoring python program that checks remote servers over ssh using paramiko and fabric api, now I want to find out if a deadlock occurred in remote server's java program.
I know that I can do this locally by using
$JAVA_HOME/bin/jstack -F `pgrep java`|grep "Deadlock"
but how can I do this over ssh using python?