Class: Setting::Monitoring

Inherits:
Setting
  • Object
show all
Defined in:
app/models/setting/monitoring.rb

Class Method Summary collapse

Class Method Details

.default_settingsObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/models/setting/monitoring.rb', line 3

def self.default_settings
  [
    set('monitoring_affect_global_status',
        _("Monitoring status will affect a host's global status when enabled"),
        true, N_('Monitoring status should affect global status')),
    set('monitoring_create_action',
        _('What action should be taken when a host is created'),
        'create', N_('Host Create Action'), nil, { :collection => proc { ::Monitoring::CREATE_ACTIONS } }),
    set('monitoring_delete_action',
        _('What action should be taken when a host is deleted'),
        'delete', N_('Host Delete Action'), nil, { :collection => proc { ::Monitoring::DELETE_ACTIONS } })
  ]
end

.humanized_categoryObject



28
29
30
# File 'app/models/setting/monitoring.rb', line 28

def self.humanized_category
  N_('Monitoring')
end

.load_defaultsObject



17
18
19
20
21
22
23
24
25
26
# File 'app/models/setting/monitoring.rb', line 17

def self.load_defaults
  # Check the table exists
  return unless super

  self.transaction do
    default_settings.each { |s| self.create! s.update(:category => 'Setting::Monitoring') }
  end

  true
end