Module: Defaults

Included in:
Inari::Commands
Defined in:
lib/inari/commands/defaults.rb

Instance Method Summary collapse

Instance Method Details

#email_on_eventsObject



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_eventsObject



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

#sigObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/inari/commands/defaults.rb', line 2

def sig
  return <<SIGNATURE

This message was reported by your system monitoring software.

--
#{Inari::APP_NAME}

SIGNATURE
end