Class: Sensu::Extension::SystemProfile

Inherits:
Check
  • Object
show all
Defined in:
lib/sensu/extensions/system-profile.rb

Instance Method Summary collapse

Instance Method Details

#definitionObject



14
15
16
17
18
19
20
21
22
# File 'lib/sensu/extensions/system-profile.rb', line 14

def definition
  {
    type: 'metric',
    name: name,
    interval: options[:interval],
    standalone: true,
    handler: options[:handler]
  }
end

#descriptionObject



10
11
12
# File 'lib/sensu/extensions/system-profile.rb', line 10

def description
  'collects system metrics, using the graphite plain-text format'
end

#nameObject



6
7
8
# File 'lib/sensu/extensions/system-profile.rb', line 6

def name
  'system_profile'
end

#post_initObject



24
25
26
# File 'lib/sensu/extensions/system-profile.rb', line 24

def post_init
  @metrics = []
end

#runObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/sensu/extensions/system-profile.rb', line 28

def run
  proc_stat_metrics do
    proc_loadavg_metrics do
      proc_net_dev_metrics do
        proc_meminfo_metrics do
          yield flush_metrics, 0
        end
      end
    end
  end
end