Class: Alerty::Plugin::Exec
- Inherits:
-
Object
- Object
- Alerty::Plugin::Exec
- Defined in:
- lib/alerty/plugin/exec.rb
Instance Method Summary collapse
- #alert(record) ⇒ Object
-
#initialize(config) ⇒ Exec
constructor
A new instance of Exec.
Constructor Details
#initialize(config) ⇒ Exec
Returns a new instance of Exec.
8 9 10 11 |
# File 'lib/alerty/plugin/exec.rb', line 8 def initialize(config) raise ConfigError.new("exec: command is not configured") unless config.command @command = config.command end |
Instance Method Details
#alert(record) ⇒ Object
13 14 15 16 |
# File 'lib/alerty/plugin/exec.rb', line 13 def alert(record) Alerty.logger.info "exec: echo #{record.to_json.shellescape} | #{@command}" Frontkick.exec("echo #{record.to_json.shellescape} | #{@command}") end |