Module: Livestatus::State

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

Instance Method Summary collapse

Instance Method Details

#stateObject



54
55
56
57
58
59
60
61
# File 'lib/livestatus/models.rb', line 54

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

#state_classObject



63
64
65
66
67
68
69
70
71
# File 'lib/livestatus/models.rb', line 63

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

#state_typeObject



73
74
75
76
77
78
# File 'lib/livestatus/models.rb', line 73

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