Class: NagiosCheck::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/nagios_check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exit_status, output, values) ⇒ Result

Returns a new instance of Result.



18
19
20
21
22
# File 'lib/nagios_check.rb', line 18

def initialize(exit_status, output, values)
  @exit_status = exit_status
  @output = output
  @values = values
end

Instance Attribute Details

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



16
17
18
# File 'lib/nagios_check.rb', line 16

def exit_status
  @exit_status
end

#outputObject (readonly)

Returns the value of attribute output.



16
17
18
# File 'lib/nagios_check.rb', line 16

def output
  @output
end

#valuesObject (readonly)

Returns the value of attribute values.



16
17
18
# File 'lib/nagios_check.rb', line 16

def values
  @values
end

Instance Method Details

#critical?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/nagios_check.rb', line 24

def critical?
  exit_status == 2
end

#ok?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/nagios_check.rb', line 32

def ok?
  exit_status == 0
end

#warning?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/nagios_check.rb', line 28

def warning?
  exit_status == 1
end