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
Methods included from Utilities::Helpers
Constructor Details
#initialize(model, &block) ⇒ Nagios
Returns a new instance of Nagios.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/backup/notifier/nagios.rb', line 27 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.
9 10 11 |
# File 'lib/backup/notifier/nagios.rb', line 9 def nagios_host @nagios_host end |
#nagios_port ⇒ Object
Port of Nagios server to notify on backup completion.
13 14 15 |
# File 'lib/backup/notifier/nagios.rb', line 13 def nagios_port @nagios_port end |
#send_nsca_cfg ⇒ Object
Nagios nrpe configuration file.
17 18 19 |
# File 'lib/backup/notifier/nagios.rb', line 17 def send_nsca_cfg @send_nsca_cfg end |
#service_host ⇒ Object
Host name in Nagios for the backup check.
25 26 27 |
# File 'lib/backup/notifier/nagios.rb', line 25 def service_host @service_host end |
#service_name ⇒ Object
Name of the Nagios service for the backup check.
21 22 23 |
# File 'lib/backup/notifier/nagios.rb', line 21 def service_name @service_name end |