Module: Defaults
- Included in:
- Inari::Commands
- Defined in:
- lib/inari/commands/defaults.rb
Instance Method Summary collapse
Instance Method Details
#email_on_events ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/inari/commands/defaults.rb', line 23 def email_on_events on_down do email(:subject => "#{current_host} is down", :body => "#{current_host} is down." + sig) end on_up do email(:subject => "#{current_host} is up (down for #{down_for} seconds)", :body => "#{current_host} is up (down for #{down_for} seconds)" + sig) end end |
#log_on_events ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/inari/commands/defaults.rb', line 13 def log_on_events on_down do Inari::logger.error("#{current_host} is down.") end on_up do Inari::logger.info("#{current_host} came back after #{down_for} seconds") end end |
#sig ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/inari/commands/defaults.rb', line 2 def sig return "\nThis message was reported by your system monitoring software.\n\n--\n\#{Inari::APP_NAME}\n\n" end |