Module: Livestatus::State

Included in:
Host, Service
Defined in:
lib/livestatus/models.rb

Instance Method Summary collapse

Instance Method Details

#stateObject



49
50
51
52
53
54
55
56
# File 'lib/livestatus/models.rb', line 49

def state
  {
    0 => :ok,
    1 => :warning,
    2 => :critical,
    3 => :unknown,
  }[data[:state]]
end

#state_classObject



58
59
60
61
62
63
64
65
66
# File 'lib/livestatus/models.rb', line 58

def state_class
  {
    :ok => :green,
    :warning => :yellow,
    :critical => :red,
    :unknown => :orange,
    :pending => :gray,
  }[state]
end

#state_typeObject



68
69
70
71
72
73
# File 'lib/livestatus/models.rb', line 68

def state_type
  {
    0 => :soft,
    1 => :hard,
  }[data[:state_type]]
end