Skip to content

Instantly share code, notes, and snippets.

@asears
Created May 3, 2016 21:48
Show Gist options
  • Save asears/47e907a28ee593a6cff19c274b5f7e9d to your computer and use it in GitHub Desktop.
Save asears/47e907a28ee593a6cff19c274b5f7e9d to your computer and use it in GitHub Desktop.
Putty - Plink - Remote execute shell script / python script to list Oozie jobs
cd /d "C:\Program Files (x86)\PuTTY"
plink root@toredge -m listjobs.sh
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=(',', ': '))
python /root/oozie/listjobs.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment