Created
May 3, 2016 21:48
-
-
Save asears/47e907a28ee593a6cff19c274b5f7e9d to your computer and use it in GitHub Desktop.
Putty - Plink - Remote execute shell script / python script to list Oozie jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /d "C:\Program Files (x86)\PuTTY" | |
plink root@toredge -m listjobs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
server = 'torhfx.t4g.com' | |
port = '11000' | |
req = urllib2.Request('http://' + server + ':' + port + '/oozie/v1/jobs?jobtype=wf') | |
response = urllib2.urlopen(req) | |
output = response.read() | |
print json.dumps(json.loads(output), indent=4, separators=(',', ': ')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python /root/oozie/listjobs.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment