Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # growl notify on cluster WAITING
- require 'rubygems'
- require 'ruby-growl'
- require 'json'
- def g(msg)
- puts "growl -> #{msg}"
- Growl.run ['-H', "127.0.0.1",
- '-m', msg,
- '-t', 'Elastic Map Reduce']
- end
- count = ARGV.first.to_i
- loop do
- desc = JSON.parse `elastic-mapreduce --describe`
- desc['JobFlows'].each do |jf|
- if jf['ExecutionStatusDetail']['State'] =~ /WAIT/
- g "#{jf['JobFlowId']} is WAITING"
- end
- end
- break if count == 1
- count -= 1
- sleep 60
- end
Add Comment
Please, Sign In to add comment