Class: Bosh::Monitor::Plugins::SyslogEventForwarder

Inherits:
Base
  • Object
show all
Defined in:
lib/bosh/monitor/plugins/syslog_event_forwarder.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#event_kinds, #logger, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #validate_options

Constructor Details

This class inherits a constructor from Bosh::Monitor::Plugins::Base

Instance Attribute Details

#sys_loggerObject (readonly)

Returns the value of attribute sys_logger.



12
13
14
# File 'lib/bosh/monitor/plugins/syslog_event_forwarder.rb', line 12

def sys_logger
  @sys_logger
end

Instance Method Details

#process(event) ⇒ Object



19
20
21
22
23
# File 'lib/bosh/monitor/plugins/syslog_event_forwarder.rb', line 19

def process(event)
  if event.kind_of?(Bosh::Monitor::Events::Alert)
    @sys_logger.info("[#{event.kind.to_s.upcase}] #{event.to_json}")
  end
end

#runObject



14
15
16
17
# File 'lib/bosh/monitor/plugins/syslog_event_forwarder.rb', line 14

def run
  @sys_logger = Syslog::Logger.new('bosh.hm') # keep programname in sync with syslog_event_forwarder.conf.erb
  logger.info("Syslog forwarder is running with programme name '#{Syslog::ident}'...")
end