Class: LoomExt::CoreFacts::SystemInfoProvider

Inherits:
Loom::Facts::Provider show all
Defined in:
lib/loomext/corefacts/system_info_provider.rb

Instance Attribute Summary

Attributes inherited from Loom::Facts::Provider

#fact_map, #namespace

Instance Method Summary collapse

Methods inherited from Loom::Facts::Provider

create_fact_providers, #disable, disable_for_host, disabled_for_host?, register_factory

Constructor Details

#initialize(host_spec, shell) ⇒ SystemInfoProvider

Returns a new instance of SystemInfoProvider.



10
11
12
13
# File 'lib/loomext/corefacts/system_info_provider.rb', line 10

def initialize(host_spec, shell)
  @shell = shell
  @namespace = :system_info
end

Instance Method Details

#collect_factsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/loomext/corefacts/system_info_provider.rb', line 15

def collect_facts
  # see:
  # https://linux.die.net/man/8/vmstat
  # https://linux.die.net/man/5/proc
  # https://linux.die.net/man/1/df
  # https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/
  {
    :vmstat => facts_from_vmstat,
    :loadavg => facts_from_proc_loadavg,
    :df => facts_from_df,
    :os_release => facts_from_etc_os_release,
    :cpu_temp => facts_from_sys_class_thermal_zones
  }
end