Class: Backup::Notifier::Nagios
- Defined in:
- lib/backup/notifier/nagios.rb
Instance Attribute Summary collapse
-
#nagios_host ⇒ Object
Host of Nagios server to notify on backup completion.
-
#nagios_port ⇒ Object
Port of Nagios server to notify on backup completion.
-
#send_nsca_cfg ⇒ Object
Nagios nrpe configuration file.
-
#service_host ⇒ Object
Host name in Nagios for the backup check.
-
#service_name ⇒ Object
Name of the Nagios service for the backup check.
Attributes inherited from Base
#max_retries, #message, #model, #on_failure, #on_success, #on_warning, #retry_waitsec
Instance Method Summary collapse
-
#initialize(model, &block) ⇒ Nagios
constructor
A new instance of Nagios.
Methods inherited from Base
Methods included from Config::Helpers
Constructor Details
#initialize(model, &block) ⇒ Nagios
Returns a new instance of Nagios.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/backup/notifier/nagios.rb', line 24 def initialize(model, &block) super instance_eval(&block) if block_given? @nagios_host ||= Config.hostname @nagios_port ||= 5667 @send_nsca_cfg ||= "/etc/nagios/send_nsca.cfg" @service_name ||= "Backup #{model.trigger}" @service_host ||= Config.hostname end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers
Instance Attribute Details
#nagios_host ⇒ Object
Host of Nagios server to notify on backup completion.
6 7 8 |
# File 'lib/backup/notifier/nagios.rb', line 6 def nagios_host @nagios_host end |
#nagios_port ⇒ Object
Port of Nagios server to notify on backup completion.
10 11 12 |
# File 'lib/backup/notifier/nagios.rb', line 10 def nagios_port @nagios_port end |
#send_nsca_cfg ⇒ Object
Nagios nrpe configuration file.
14 15 16 |
# File 'lib/backup/notifier/nagios.rb', line 14 def send_nsca_cfg @send_nsca_cfg end |
#service_host ⇒ Object
Host name in Nagios for the backup check.
22 23 24 |
# File 'lib/backup/notifier/nagios.rb', line 22 def service_host @service_host end |
#service_name ⇒ Object
Name of the Nagios service for the backup check.
18 19 20 |
# File 'lib/backup/notifier/nagios.rb', line 18 def service_name @service_name end |