Class: Backup::Notifier::Zabbix

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/notifier/zabbix.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#max_retries, #message, #model, #on_failure, #on_success, #on_warning, #retry_waitsec

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Config::Helpers

included

Constructor Details

#initialize(model, &block) ⇒ Zabbix

Returns a new instance of Zabbix.



17
18
19
20
21
22
23
24
25
26
# File 'lib/backup/notifier/zabbix.rb', line 17

def initialize(model, &block)
  super
  instance_eval(&block) if block_given?

  @zabbix_host  ||= Config.hostname
  @zabbix_port  ||= 10051
  @service_name ||= "Backup #{ model.trigger }"
  @service_host ||= Config.hostname
  @item_key     ||= 'backup_status'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers

Instance Attribute Details

#item_keyObject

Returns the value of attribute item_key.



15
16
17
# File 'lib/backup/notifier/zabbix.rb', line 15

def item_key
  @item_key
end

#service_hostObject

Returns the value of attribute service_host.



13
14
15
# File 'lib/backup/notifier/zabbix.rb', line 13

def service_host
  @service_host
end

#service_nameObject

Returns the value of attribute service_name.



11
12
13
# File 'lib/backup/notifier/zabbix.rb', line 11

def service_name
  @service_name
end

#zabbix_hostObject

Returns the value of attribute zabbix_host.



7
8
9
# File 'lib/backup/notifier/zabbix.rb', line 7

def zabbix_host
  @zabbix_host
end

#zabbix_portObject

Returns the value of attribute zabbix_port.



9
10
11
# File 'lib/backup/notifier/zabbix.rb', line 9

def zabbix_port
  @zabbix_port
end