ohai 8.8.1 → 8.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/Rakefile +6 -0
- data/bin/ohai +2 -2
- data/lib/ohai.rb +4 -4
- data/lib/ohai/config.rb +2 -2
- data/lib/ohai/dsl.rb +2 -2
- data/lib/ohai/dsl/plugin.rb +3 -3
- data/lib/ohai/dsl/plugin/versionvi.rb +3 -3
- data/lib/ohai/dsl/plugin/versionvii.rb +2 -2
- data/lib/ohai/exception.rb +2 -2
- data/lib/ohai/hints.rb +2 -2
- data/lib/ohai/loader.rb +1 -1
- data/lib/ohai/log.rb +2 -2
- data/lib/ohai/mixin/command.rb +2 -2
- data/lib/ohai/mixin/constant_helper.rb +2 -2
- data/lib/ohai/mixin/dmi_decode.rb +1 -1
- data/lib/ohai/mixin/ec2_metadata.rb +3 -3
- data/lib/ohai/mixin/network_constants.rb +4 -4
- data/lib/ohai/mixin/os.rb +2 -2
- data/lib/ohai/mixin/seconds_to_human.rb +4 -4
- data/lib/ohai/mixin/string.rb +4 -4
- data/lib/ohai/plugin_config.rb +1 -1
- data/lib/ohai/plugins/aix/cpu.rb +35 -29
- data/lib/ohai/plugins/aix/filesystem.rb +58 -40
- data/lib/ohai/plugins/aix/kernel.rb +3 -2
- data/lib/ohai/plugins/aix/memory.rb +4 -3
- data/lib/ohai/plugins/aix/network.rb +6 -4
- data/lib/ohai/plugins/aix/os.rb +30 -0
- data/lib/ohai/plugins/aix/platform.rb +3 -2
- data/lib/ohai/plugins/aix/uptime.rb +3 -2
- data/lib/ohai/plugins/aix/virtualization.rb +115 -5
- data/lib/ohai/plugins/azure.rb +1 -1
- data/lib/ohai/plugins/bsd/filesystem.rb +1 -1
- data/lib/ohai/plugins/command.rb +4 -4
- data/lib/ohai/plugins/darwin/cpu.rb +5 -3
- data/lib/ohai/plugins/darwin/filesystem.rb +4 -4
- data/lib/ohai/plugins/darwin/filesystem2.rb +4 -4
- data/lib/ohai/plugins/darwin/memory.rb +6 -5
- data/lib/ohai/plugins/darwin/network.rb +2 -2
- data/lib/ohai/plugins/darwin/platform.rb +2 -2
- data/lib/ohai/plugins/darwin/system_profiler.rb +2 -2
- data/lib/ohai/plugins/dragonflybsd/os.rb +2 -2
- data/lib/ohai/plugins/ec2.rb +3 -3
- data/lib/ohai/plugins/erlang.rb +3 -3
- data/lib/ohai/plugins/eucalyptus.rb +3 -3
- data/lib/ohai/plugins/freebsd/cpu.rb +8 -4
- data/lib/ohai/plugins/freebsd/os.rb +2 -2
- data/lib/ohai/plugins/hostname.rb +12 -4
- data/lib/ohai/plugins/init_package.rb +2 -8
- data/lib/ohai/plugins/java.rb +2 -2
- data/lib/ohai/plugins/kernel.rb +5 -4
- data/lib/ohai/plugins/keys.rb +3 -3
- data/lib/ohai/plugins/languages.rb +4 -4
- data/lib/ohai/plugins/linux/block_device.rb +3 -3
- data/lib/ohai/plugins/linux/cpu.rb +2 -2
- data/lib/ohai/plugins/linux/filesystem.rb +2 -2
- data/lib/ohai/plugins/linux/filesystem2.rb +3 -3
- data/lib/ohai/plugins/linux/lsb.rb +2 -2
- data/lib/ohai/plugins/linux/memory.rb +2 -2
- data/lib/ohai/plugins/linux/network.rb +141 -59
- data/lib/ohai/plugins/linux/platform.rb +6 -1
- data/lib/ohai/plugins/linux/virtualization.rb +1 -1
- data/lib/ohai/plugins/network.rb +49 -42
- data/lib/ohai/plugins/ohai_time.rb +4 -4
- data/lib/ohai/plugins/openstack.rb +2 -2
- data/lib/ohai/plugins/os.rb +2 -2
- data/lib/ohai/plugins/packages.rb +122 -0
- data/lib/ohai/plugins/perl.rb +5 -5
- data/lib/ohai/plugins/platform.rb +2 -2
- data/lib/ohai/plugins/powershell.rb +2 -2
- data/lib/ohai/plugins/ps.rb +2 -2
- data/lib/ohai/plugins/python.rb +1 -1
- data/lib/ohai/plugins/rackspace.rb +13 -0
- data/lib/ohai/plugins/ruby.rb +6 -6
- data/lib/ohai/plugins/sigar/network_route.rb +1 -1
- data/lib/ohai/plugins/solaris2/filesystem.rb +1 -1
- data/lib/ohai/plugins/solaris2/network.rb +1 -1
- data/lib/ohai/plugins/solaris2/platform.rb +1 -1
- data/lib/ohai/plugins/solaris2/virtualization.rb +5 -5
- data/lib/ohai/plugins/solaris2/zpools.rb +2 -2
- data/lib/ohai/plugins/ssh_host_key.rb +2 -2
- data/lib/ohai/plugins/uptime.rb +4 -4
- data/lib/ohai/plugins/virtualbox.rb +1 -1
- data/lib/ohai/plugins/virtualization.rb +7 -7
- data/lib/ohai/plugins/vmware.rb +1 -1
- data/lib/ohai/plugins/windows/filesystem.rb +1 -1
- data/lib/ohai/plugins/windows/network.rb +1 -1
- data/lib/ohai/plugins/windows/platform.rb +1 -1
- data/lib/ohai/plugins/windows/virtualization.rb +1 -1
- data/lib/ohai/provides_map.rb +3 -3
- data/lib/ohai/runner.rb +2 -2
- data/lib/ohai/system.rb +2 -2
- data/lib/ohai/util/file_helper.rb +1 -1
- data/lib/ohai/util/win32.rb +1 -1
- data/lib/ohai/util/win32/group_helper.rb +1 -1
- data/lib/ohai/version.rb +3 -3
- data/spec/data/plugins/dpkg-query.output +1087 -0
- data/spec/data/plugins/lslpp.output +49 -0
- data/spec/data/plugins/pkginfo.output +50 -0
- data/spec/data/plugins/pkglist.output +24 -0
- data/spec/data/plugins/rpmquery.output +388 -0
- data/spec/functional/application_spec.rb +1 -1
- data/spec/functional/loader_spec.rb +1 -1
- data/spec/functional/plugins/powershell_spec.rb +1 -1
- data/spec/functional/plugins/root_group_spec.rb +2 -2
- data/spec/ohai_spec.rb +6 -6
- data/spec/unit/application_spec.rb +1 -1
- data/spec/unit/config_spec.rb +1 -1
- data/spec/unit/dsl/plugin_spec.rb +2 -2
- data/spec/unit/hints_spec.rb +2 -2
- data/spec/unit/loader_spec.rb +2 -2
- data/spec/unit/mixin/ec2_metadata_spec.rb +1 -1
- data/spec/unit/plugin_config_spec.rb +1 -1
- data/spec/unit/plugins/aix/cpu_spec.rb +68 -40
- data/spec/unit/plugins/aix/filesystem_spec.rb +152 -50
- data/spec/unit/plugins/aix/hostname_spec.rb +5 -3
- data/spec/unit/plugins/aix/kernel_spec.rb +2 -1
- data/spec/unit/plugins/aix/memory_spec.rb +7 -5
- data/spec/unit/plugins/aix/network_spec.rb +17 -1
- data/spec/unit/plugins/aix/os_spec.rb +35 -0
- data/spec/unit/plugins/aix/platform_spec.rb +5 -4
- data/spec/unit/plugins/aix/uptime_spec.rb +2 -1
- data/spec/unit/plugins/aix/virtualization_spec.rb +269 -3
- data/spec/unit/plugins/azure_spec.rb +1 -1
- data/spec/unit/plugins/bsd/filesystem_spec.rb +1 -1
- data/spec/unit/plugins/bsd/virtualization_spec.rb +2 -2
- data/spec/unit/plugins/chef_spec.rb +8 -8
- data/spec/unit/plugins/darwin/cpu_spec.rb +8 -3
- data/spec/unit/plugins/darwin/hostname_spec.rb +2 -2
- data/spec/unit/plugins/darwin/kernel_spec.rb +4 -4
- data/spec/unit/plugins/darwin/memory_spec.rb +1 -1
- data/spec/unit/plugins/darwin/network_spec.rb +1 -1
- data/spec/unit/plugins/darwin/platform_spec.rb +6 -6
- data/spec/unit/plugins/darwin/system_profiler_output.rb +0 -1
- data/spec/unit/plugins/darwin/system_profiler_spec.rb +4 -4
- data/spec/unit/plugins/ec2_spec.rb +3 -3
- data/spec/unit/plugins/erlang_spec.rb +3 -3
- data/spec/unit/plugins/eucalyptus_spec.rb +2 -2
- data/spec/unit/plugins/fail_spec.rb +6 -6
- data/spec/unit/plugins/freebsd/cpu_spec.rb +19 -4
- data/spec/unit/plugins/freebsd/hostname_spec.rb +2 -2
- data/spec/unit/plugins/freebsd/kernel_spec.rb +4 -4
- data/spec/unit/plugins/freebsd/platform_spec.rb +7 -7
- data/spec/unit/plugins/hostname_spec.rb +2 -2
- data/spec/unit/plugins/init_package_spec.rb +12 -2
- data/spec/unit/plugins/java_spec.rb +5 -5
- data/spec/unit/plugins/kernel_spec.rb +4 -2
- data/spec/unit/plugins/linux/block_device_spec.rb +75 -0
- data/spec/unit/plugins/linux/cpu_spec.rb +2 -2
- data/spec/unit/plugins/linux/filesystem2_spec.rb +14 -14
- data/spec/unit/plugins/linux/filesystem_spec.rb +1 -1
- data/spec/unit/plugins/linux/hostname_spec.rb +2 -2
- data/spec/unit/plugins/linux/kernel_spec.rb +5 -5
- data/spec/unit/plugins/linux/lsb_spec.rb +17 -17
- data/spec/unit/plugins/linux/network_spec.rb +80 -11
- data/spec/unit/plugins/linux/platform_spec.rb +20 -1
- data/spec/unit/plugins/linux/uptime_spec.rb +8 -8
- data/spec/unit/plugins/linux/virtualization_spec.rb +1 -1
- data/spec/unit/plugins/lua_spec.rb +2 -2
- data/spec/unit/plugins/netbsd/hostname_spec.rb +2 -2
- data/spec/unit/plugins/netbsd/kernel_spec.rb +2 -2
- data/spec/unit/plugins/netbsd/platform_spec.rb +2 -2
- data/spec/unit/plugins/network_spec.rb +110 -37
- data/spec/unit/plugins/nodejs_spec.rb +2 -2
- data/spec/unit/plugins/ohai_spec.rb +5 -5
- data/spec/unit/plugins/ohai_time_spec.rb +8 -8
- data/spec/unit/plugins/openbsd/hostname_spec.rb +2 -2
- data/spec/unit/plugins/openbsd/kernel_spec.rb +4 -4
- data/spec/unit/plugins/openbsd/platform_spec.rb +6 -6
- data/spec/unit/plugins/openstack_spec.rb +2 -2
- data/spec/unit/plugins/os_spec.rb +11 -11
- data/spec/unit/plugins/packages_spec.rb +241 -0
- data/spec/unit/plugins/perl_spec.rb +3 -3
- data/spec/unit/plugins/php_spec.rb +2 -2
- data/spec/unit/plugins/platform_spec.rb +2 -2
- data/spec/unit/plugins/python_spec.rb +3 -3
- data/spec/unit/plugins/rackspace_spec.rb +7 -0
- data/spec/unit/plugins/ruby_spec.rb +3 -3
- data/spec/unit/plugins/sigar/network_route_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/cpu_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/filesystem.rb +1 -1
- data/spec/unit/plugins/solaris2/network_spec.rb +3 -3
- data/spec/unit/plugins/solaris2/platform_spec.rb +5 -5
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +1 -1
- data/spec/unit/plugins/ssh_host_keys_spec.rb +2 -2
- data/spec/unit/plugins/virtualbox_spec.rb +1 -1
- data/spec/unit/plugins/windows/virtualization_spec.rb +1 -1
- data/spec/unit/provides_map_spec.rb +2 -2
- data/spec/unit/runner_spec.rb +2 -2
- data/spec/unit/system_spec.rb +3 -3
- data/spec/unit/util/file_helper_spec.rb +1 -1
- metadata +13 -3
@@ -1,6 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Joshua Timberman <joshua@
|
3
|
-
#
|
2
|
+
# Author:: Joshua Timberman <joshua@chef.io>
|
3
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
4
5
|
# License:: Apache License, Version 2.0
|
5
6
|
#
|
6
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Joshua Timberman <joshua@
|
3
|
-
#
|
2
|
+
# Author:: Joshua Timberman <joshua@chef.io>
|
3
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
4
5
|
# License:: Apache License, Version 2.0
|
5
6
|
#
|
6
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -27,7 +28,7 @@ Ohai.plugin(:Memory) do
|
|
27
28
|
total_in_mb, u, free_in_mb = meminfo.split
|
28
29
|
memory[:total] = "#{total_in_mb.to_i * 1024}kB"
|
29
30
|
memory[:free] = "#{free_in_mb.to_i * 1024}kB"
|
30
|
-
|
31
|
+
|
31
32
|
swapinfo = shell_out("swap -s").stdout.split #returns swap info in 4K blocks
|
32
33
|
memory[:swap]['total'] = "#{(swapinfo[2].to_i) * 4}kB"
|
33
34
|
memory[:swap]['free'] = "#{(swapinfo[10].to_i) * 4}kB"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
|
3
3
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
4
4
|
# Author:: Isa Farnik (<isa@chef.io>)
|
5
|
-
# Copyright:: Copyright (c)
|
5
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
6
6
|
# License:: Apache License, Version 2.0
|
7
7
|
#
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -21,7 +21,7 @@
|
|
21
21
|
Ohai.plugin(:Network) do
|
22
22
|
require 'ipaddr'
|
23
23
|
|
24
|
-
provides "network", "counters/network"
|
24
|
+
provides "network", "counters/network", "macaddress"
|
25
25
|
|
26
26
|
# Helpers
|
27
27
|
def hex_to_dec_netmask(netmask)
|
@@ -115,7 +115,10 @@ Ohai.plugin(:Network) do
|
|
115
115
|
e_so = shell_out("entstat -d #{interface} | grep \"Hardware Address\"")
|
116
116
|
iface[interface][:addresses] = Mash.new unless iface[interface][:addresses]
|
117
117
|
e_so.stdout.lines.each do |line|
|
118
|
-
|
118
|
+
if line =~ /Hardware Address: (\S+)/
|
119
|
+
iface[interface][:addresses][$1.upcase] = { "family" => "lladdr" }
|
120
|
+
macaddress $1.upcase unless shell_out("uname -W").stdout.to_i > 0
|
121
|
+
end
|
119
122
|
end
|
120
123
|
end #ifconfig stdout
|
121
124
|
|
@@ -145,7 +148,6 @@ Ohai.plugin(:Network) do
|
|
145
148
|
count += 1
|
146
149
|
end
|
147
150
|
end
|
148
|
-
|
149
151
|
network["interfaces"] = iface
|
150
152
|
end
|
151
153
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
3
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
5
|
+
# License:: Apache License, Version 2.0
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'ohai/mixin/os'
|
21
|
+
|
22
|
+
Ohai.plugin(:OS) do
|
23
|
+
provides "os", "os_version"
|
24
|
+
depends 'kernel'
|
25
|
+
|
26
|
+
collect_data(:aix) do
|
27
|
+
os collect_os
|
28
|
+
os_version kernel[:version]
|
29
|
+
end
|
30
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Joshua Timberman <joshua@
|
3
|
-
#
|
2
|
+
# Author:: Joshua Timberman <joshua@chef.io>
|
3
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
4
5
|
# License:: Apache License, Version 2.0
|
5
6
|
#
|
6
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
|
3
|
-
#
|
3
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
4
5
|
# License:: Apache License, Version 2.0
|
5
6
|
#
|
6
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -33,4 +34,4 @@ Ohai.plugin(:Uptime) do
|
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
36
|
-
end
|
37
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Julian C. Dunn (<jdunn@
|
3
|
-
#
|
2
|
+
# Author:: Julian C. Dunn (<jdunn@chef.io>)
|
3
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
4
5
|
# License:: Apache License, Version 2.0
|
5
6
|
#
|
6
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -17,7 +18,7 @@
|
|
17
18
|
#
|
18
19
|
|
19
20
|
Ohai.plugin(:Virtualization) do
|
20
|
-
provides "virtualization"
|
21
|
+
provides "virtualization", "virtualization/wpars"
|
21
22
|
|
22
23
|
collect_data(:aix) do
|
23
24
|
virtualization Mash.new
|
@@ -33,7 +34,116 @@ Ohai.plugin(:Virtualization) do
|
|
33
34
|
|
34
35
|
so = shell_out("uname -W")
|
35
36
|
wpar_no = so.stdout.split($/)[0]
|
36
|
-
|
37
|
+
if wpar_no.to_i > 0
|
38
|
+
virtualization[:wpar_no] = wpar_no
|
39
|
+
else
|
40
|
+
# the below parses the output of lswpar in the long format
|
41
|
+
so = shell_out("lswpar -L").stdout.scan(/={65}.*?(?:EXPORTED\n\n)+/m)
|
42
|
+
wpars = Mash.new
|
43
|
+
so.each do |wpar|
|
44
|
+
wpar_name = wpar.lines[1].split[0]
|
45
|
+
wpars[wpar_name] = Mash.new
|
37
46
|
|
47
|
+
wpar.scan(/^[A-Z]{4,}.*?[A-Z\:0-9]$.*?\n\n/m).each do |section|
|
48
|
+
|
49
|
+
# retrieve title of section
|
50
|
+
title = section.lines.first[0..-2].downcase
|
51
|
+
wpars[wpar_name][title] = Mash.new
|
52
|
+
|
53
|
+
# discard trailing section newline+title
|
54
|
+
# and save as array
|
55
|
+
sections = section.lines[1..-2]
|
56
|
+
|
57
|
+
sections.each do |line|
|
58
|
+
case title
|
59
|
+
when 'network'
|
60
|
+
next if line =~ /^Interface|^---/
|
61
|
+
splat = line.strip.split
|
62
|
+
key = splat[0].downcase
|
63
|
+
value = {
|
64
|
+
'address' => splat[1],
|
65
|
+
'netmask' => splat[2],
|
66
|
+
'broadcast' => splat[3],
|
67
|
+
}
|
68
|
+
wpars[wpar_name][title][key] = value
|
69
|
+
when 'user-specified routes'
|
70
|
+
next if line =~ /^Type|^---/
|
71
|
+
splat = line.strip.split
|
72
|
+
key = splat[2].downcase
|
73
|
+
value = {
|
74
|
+
'destination' => splat[0],
|
75
|
+
'gateway' => splat[1],
|
76
|
+
}
|
77
|
+
wpars[wpar_name][title][key] = value
|
78
|
+
when 'file systems'
|
79
|
+
next if line =~ /^MountPoint|^---/
|
80
|
+
splat = line.strip.split
|
81
|
+
key = splat[1].downcase
|
82
|
+
value = {
|
83
|
+
'mountpoint' => splat[0],
|
84
|
+
'device' => splat[1],
|
85
|
+
'vfs' => splat[2],
|
86
|
+
'options' => splat[3].split(','),
|
87
|
+
}
|
88
|
+
wpars[wpar_name][title][key] = value
|
89
|
+
when 'security settings'
|
90
|
+
privileges ||= ''
|
91
|
+
wpars[wpar_name][title]['Privileges'] ||= []
|
92
|
+
|
93
|
+
if line =~ /^Privileges/
|
94
|
+
privileges << line.split(':')[1].strip
|
95
|
+
else
|
96
|
+
privileges << line.strip
|
97
|
+
end
|
98
|
+
|
99
|
+
wpars[wpar_name][title]['Privileges'] += privileges.split(',')
|
100
|
+
when 'device exports'
|
101
|
+
next if line =~ /^Name|^---/
|
102
|
+
splat = line.strip.split
|
103
|
+
key = splat[0].downcase
|
104
|
+
value = {
|
105
|
+
'type' => splat[1],
|
106
|
+
'status' => splat[2],
|
107
|
+
}
|
108
|
+
wpars[wpar_name][title][key] = value
|
109
|
+
else
|
110
|
+
# key-value pairs are handled here
|
111
|
+
# such as GENERAL and RESOURCE-
|
112
|
+
# CONTROL
|
113
|
+
splat = line.strip.split(':')
|
114
|
+
key = splat[0].downcase
|
115
|
+
value = splat[1..-1].join(', ').strip
|
116
|
+
value = value.empty? ? nil : value
|
117
|
+
case value
|
118
|
+
when "yes"
|
119
|
+
value = true
|
120
|
+
when "no"
|
121
|
+
value = false
|
122
|
+
end
|
123
|
+
wpars[wpar_name][title][key] = value
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
top_level = [
|
128
|
+
"general.directory",
|
129
|
+
"general.hostname",
|
130
|
+
"general.private /usr",
|
131
|
+
"general.type",
|
132
|
+
"general.uuid",
|
133
|
+
"resource controls.active",
|
134
|
+
"network.en0.address",
|
135
|
+
]
|
136
|
+
|
137
|
+
top_level.each do |attribute|
|
138
|
+
evalstr = "wpars['#{wpar_name}']"
|
139
|
+
breadcrumb = attribute.split('.')
|
140
|
+
breadcrumb.each do |node|
|
141
|
+
evalstr << "[\'#{node}\']"
|
142
|
+
end
|
143
|
+
wpars[wpar_name][breadcrumb[-1]] = eval evalstr
|
144
|
+
end
|
145
|
+
end
|
146
|
+
virtualization[:wpars] = wpars unless wpars.empty?
|
147
|
+
end
|
38
148
|
end
|
39
|
-
end
|
149
|
+
end
|
data/lib/ohai/plugins/azure.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
3
3
|
# Author:: Tim Smith (<tsmith@chef.io>)
|
4
|
-
# Copyright:: Copyright (c) 2008-
|
4
|
+
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/ohai/plugins/command.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Adam Jacob (<adam@
|
3
|
-
# Copyright:: Copyright (c) 2008
|
2
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
14
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Nathan L Smith (<nlloyds@gmail.com>)
|
3
|
-
# Author:: Tim Smith (<tsmith@
|
4
|
-
# Copyright:: Copyright (c) 2013
|
3
|
+
# Author:: Tim Smith (<tsmith@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -22,8 +22,10 @@ Ohai.plugin(:CPU) do
|
|
22
22
|
|
23
23
|
collect_data(:darwin) do
|
24
24
|
cpu Mash.new
|
25
|
-
so = shell_out("sysctl -n hw.
|
25
|
+
so = shell_out("sysctl -n hw.packages")
|
26
26
|
cpu[:real] = so.stdout.to_i
|
27
|
+
so = shell_out("sysctl -n hw.physicalcpu")
|
28
|
+
cpu[:cores] = so.stdout.to_i
|
27
29
|
so = shell_out("sysctl -n hw.logicalcpu")
|
28
30
|
cpu[:total] = so.stdout.to_i
|
29
31
|
so = shell_out("sysctl -n hw.cpufrequency")
|
@@ -1,14 +1,14 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Benjamin Black (<bb@
|
3
|
-
# Copyright:: Copyright (c) 2009
|
2
|
+
# Author:: Benjamin Black (<bb@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
14
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -1,16 +1,16 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Phil Dibowitz (<phil@ipom.com>)
|
3
|
-
# Author:: Benjamin Black (<bb@
|
4
|
-
# Copyright:: Copyright (c) 2009
|
3
|
+
# Author:: Benjamin Black (<bb@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
|
5
5
|
# Copyright:: Copyright (c) 2015 Facebook, Inc.
|
6
6
|
# License:: Apache License, Version 2.0
|
7
7
|
#
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
9
|
# you may not use this file except in compliance with the License.
|
10
10
|
# You may obtain a copy of the License at
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# Unless required by applicable law or agreed to in writing, software
|
15
15
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
16
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Patrick Collins (<pat@burned.com>)
|
3
|
-
# Copyright:: Copyright (c) 2013
|
3
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -31,10 +31,11 @@ Ohai.plugin(:Memory) do
|
|
31
31
|
vm_stat = shell_out("vm_stat").stdout
|
32
32
|
vm_stat_match = /page size of (\d+) bytes/.match(vm_stat)
|
33
33
|
page_size = if vm_stat_match and vm_stat_match[1]
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
vm_stat_match[1].to_i
|
35
|
+
else
|
36
|
+
4096
|
37
|
+
end
|
38
|
+
|
38
39
|
vm_stat.split("\n").each do |line|
|
39
40
|
['wired down', 'active', 'inactive'].each do |match|
|
40
41
|
unless line.index("Pages #{match}:").nil?
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Benjamin Black (<bb@
|
3
|
-
# Copyright:: Copyright (c) 2008
|
2
|
+
# Author:: Benjamin Black (<bb@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Adam Jacob (<adam@
|
3
|
-
# Copyright:: Copyright (c) 2008
|
2
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Benjamin Black (<bb@
|
3
|
-
# Copyright:: Copyright (c) 2009
|
2
|
+
# Author:: Benjamin Black (<bb@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Authors:: Adam Jacob (<adam@
|
2
|
+
# Authors:: Adam Jacob (<adam@chef.io>)
|
3
3
|
# Richard Manyanza (<liseki@nyikacraftsmen.com>)
|
4
|
-
# Copyright:: Copyright (c) 2008
|
4
|
+
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
5
5
|
# Copyright:: Copyright (c) 2014 Richard Manyanza.
|
6
6
|
# License:: Apache License, Version 2.0
|
7
7
|
#
|
data/lib/ohai/plugins/ec2.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Tim Dysinger (<tim@dysinger.net>)
|
3
|
-
# Author:: Benjamin Black (<bb@
|
4
|
-
# Author:: Christopher Brown (<cb@
|
5
|
-
# Copyright:: Copyright (c) 2009
|
3
|
+
# Author:: Benjamin Black (<bb@chef.io>)
|
4
|
+
# Author:: Christopher Brown (<cb@chef.io>)
|
5
|
+
# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
|
6
6
|
# License:: Apache License, Version 2.0
|
7
7
|
#
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/ohai/plugins/erlang.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Joe Williams (<joe@joetify.com>)
|
3
|
-
# Copyright:: Copyright (c) 2008
|
3
|
+
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
14
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|