Top Level Namespace

Defined Under Namespace

Modules: EY Classes: AbstractMonitor, AlertAgent, AppMasterMonitor, AppMonitor, DbMasterMonitor, DbSlaveMonitor, MonitorAgent, MonitorFactory, MonitorGroup, MonitorGroupTimeStamp, MonitorResult, Packet, Quit, SoloMonitor, UtilMonitor, Utils

Instance Method Summary collapse

Instance Method Details

#next_envs(page, q) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/cron_feeder.rb', line 32

def next_envs(page, q)
  envs = Environment.paginate(:page => page).each do |e|
    arr = []
    e.instances(:status => :running).each do |i|
      host = i.public_hostname
      next unless host
      arr << {:host => host, :role => i.role, :token => i.token}
    end
    
    next if arr.empty?
    
    mg = MonitorGroup.new e.id, HOSTNAME, arr
    
    puts "publishing:  #{mg}"
    
    q.publish(mg.to_json)
  end
end