Class: Nagios::MkLiveStatus::Wait::Trigger

Inherits:
Nagios::MkLiveStatus::Wait show all
Includes:
Nagios::MkLiveStatus, QueryHelper::Trigger
Defined in:
lib/nagios_mklivestatus/wait/trigger.rb

Overview

This class is used to make a wait trigger.

Author

Esco-lan Team ([email protected])

Copyright

Copyright © 2012 GIP RECIA

License

General Public Licence

Constant Summary

Constants included from QueryHelper::Trigger

QueryHelper::Trigger::ALL, QueryHelper::Trigger::CHECK, QueryHelper::Trigger::COMMAND, QueryHelper::Trigger::COMMENT, QueryHelper::Trigger::DOWNTIME, QueryHelper::Trigger::LOG, QueryHelper::Trigger::STATE

Instance Method Summary collapse

Methods included from QueryHelper::Trigger

#get_all_triggers

Methods included from Nagios::MkLiveStatus

init, #logger

Constructor Details

#initialize(trigger = ALL) ⇒ Trigger

Create a new wait trigger expression.



14
15
16
17
18
19
20
21
22
# File 'lib/nagios_mklivestatus/wait/trigger.rb', line 14

def initialize(trigger=ALL)
  list_triggers = get_all_triggers
  if not list_triggers.include? trigger
    raise QueryException.new("The trigger value must be one of #{list_triggers.join(', ')}")
  end
  
  @trigger = trigger
  
end

Instance Method Details

#to_sObject

Convert the current trigger expression into a nagios query string.

WaitTrigger: ...


28
29
30
# File 'lib/nagios_mklivestatus/wait/trigger.rb', line 28

def to_s
   return "WaitTrigger: "+@trigger
end