class Opswatch::Main

Public Class Methods

new() click to toggle source
# File lib/opswatch.rb, line 11
def initialize
  settings = Configuration.load_file(".opswatch.yml")
  @groups = {}
  settings.each do |k, v|
    @groups[k] = { tray: OpsTray.new(k, IconPack.new(k)), poller: AwsPoller.new(v) }
  end

  Gtk.timeout_add(5000) { poll }
end
start(_argv = nil) click to toggle source
# File lib/opswatch.rb, line 21
def self.start(_argv = nil)
  @instance = new

  Gtk.main
end

Private Instance Methods

poll() click to toggle source
# File lib/opswatch.rb, line 29
def poll
  @groups.each do |_k, g|
    res = g[:poller].poll
    g[:tray].update_status(res)
  end
  true
end