ohai 8.8.1 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 045c43590e3c7ece0dc1cf3c6aa928b5f116c136
|
|
4
|
+
data.tar.gz: 020c8dfeabd26ba77291ba80e445b5ca3d61d661
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 482f14bc6fee2caab189234bf52ee9bbc0c0437f18da3efe2a52b28544ff6080886ef7d4d2ffb84f647a4d19de9144f00c6f16a92ccaa2a6a5dfe3ce105627e8
|
|
7
|
+
data.tar.gz: fe03f4ace8579e38373ff3fd244c3dd6a47a0738a401f65c673ff4a22c6fc284c3cca8c1788d6c533f03140f78f2ad7dd8a2d71ed8689bbf1d626ac51bcce636
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -77,7 +77,7 @@ Issues:
|
|
|
77
77
|
Ohai - system information application
|
|
78
78
|
|
|
79
79
|
* Author:: Adam Jacob (<adam@chef.io>)
|
|
80
|
-
* Copyright:: Copyright (c) 2008-
|
|
80
|
+
* Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
|
81
81
|
* License:: Apache License, Version 2.0
|
|
82
82
|
|
|
83
83
|
```text
|
data/Rakefile
CHANGED
data/bin/ohai
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
#
|
|
3
3
|
# ./ohai - I'm in ur serverz, showin you the daters
|
|
4
4
|
#
|
|
5
|
-
# Author:: Adam Jacob (<adam@
|
|
6
|
-
# Copyright:: Copyright (c) 2008
|
|
5
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
|
6
|
+
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
|
|
7
7
|
# License:: Apache License, Version 2.0
|
|
8
8
|
#
|
|
9
9
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/ohai.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.
|
data/lib/ohai/config.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Adam Jacob (<adam@
|
|
2
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
|
3
3
|
# Author:: Claire McQuin (<claire@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/dsl.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Serdar Sutay (<serdar@
|
|
3
|
-
# Copyright:: Copyright (c) 2013
|
|
2
|
+
# Author:: Serdar Sutay (<serdar@chef.io>)
|
|
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");
|
data/lib/ohai/dsl/plugin.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Adam Jacob (<adam@
|
|
3
|
-
# Author:: Claire McQuin (<claire@
|
|
4
|
-
# Copyright:: Copyright (c) 2008
|
|
2
|
+
# Author:: Adam Jacob (<adam@chef.io>)
|
|
3
|
+
# Author:: Claire McQuin (<claire@chef.io>)
|
|
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");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Serdar Sutay (<serdar@
|
|
3
|
-
# Copyright:: Copyright (c) 2013
|
|
2
|
+
# Author:: Serdar Sutay (<serdar@chef.io>)
|
|
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");
|
|
@@ -33,7 +33,7 @@ module Ohai
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def name
|
|
36
|
-
# Ohai V6 doesn't have any name specification for plugins.
|
|
36
|
+
# Ohai V6 doesn't have any name specification for plugins.
|
|
37
37
|
# So we are using the partial path to infer the name of the plugin
|
|
38
38
|
partial_path = Pathname.new(@source).relative_path_from(Pathname.new(@plugin_dir_path)).to_s
|
|
39
39
|
partial_path.chomp(".rb").gsub("/", "::")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Serdar Sutay (<serdar@
|
|
3
|
-
# Copyright:: Copyright (c) 2013
|
|
2
|
+
# Author:: Serdar Sutay (<serdar@chef.io>)
|
|
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");
|
data/lib/ohai/exception.rb
CHANGED
|
@@ -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");
|
data/lib/ohai/hints.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Serdar Sutay (<serdar@
|
|
3
|
-
# Copyright:: Copyright (c) 2013
|
|
2
|
+
# Author:: Serdar Sutay (<serdar@chef.io>)
|
|
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");
|
data/lib/ohai/loader.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Claire McQuin (<claire@chef.io>)
|
|
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");
|
data/lib/ohai/log.rb
CHANGED
|
@@ -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");
|
data/lib/ohai/mixin/command.rb
CHANGED
|
@@ -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:: Serdar Sutay (<serdar@
|
|
3
|
-
# Copyright:: Copyright (c) 2014
|
|
2
|
+
# Author:: Serdar Sutay (<serdar@chef.io>)
|
|
3
|
+
# Copyright:: Copyright (c) 2014-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
2
|
# Author:: Tim Smith <tsmith@chef.io>
|
|
3
|
-
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
|
3
|
+
# Copyright:: Copyright (c) 2015-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,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");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Serdar Sutay (<serdar@
|
|
3
|
-
# Copyright:: Copyright (c) 2014
|
|
2
|
+
# Author:: Serdar Sutay (<serdar@chef.io>)
|
|
3
|
+
# Copyright:: Copyright (c) 2014-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");
|
|
@@ -26,8 +26,8 @@ module Ohai
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
# From sigar: include/sigar.h sigar_net_route_t
|
|
29
|
-
SIGAR_ROUTE_METHODS = [:destination, :gateway, :mask, :flags,
|
|
30
|
-
:refcnt, :use, :metric, :mtu, :window,
|
|
29
|
+
SIGAR_ROUTE_METHODS = [:destination, :gateway, :mask, :flags,
|
|
30
|
+
:refcnt, :use, :metric, :mtu, :window,
|
|
31
31
|
:irtt, :ifname]
|
|
32
32
|
end
|
|
33
33
|
end
|
data/lib/ohai/mixin/os.rb
CHANGED
|
@@ -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,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.
|
data/lib/ohai/mixin/string.rb
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: James Gartrell (<jgartrel@gmail.com>)
|
|
3
|
-
# Copyright:: Copyright (c) 2009
|
|
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.
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
class String
|
|
20
20
|
# Add string function to handle WMI property conversion to json hash keys
|
|
21
21
|
# Makes an underscored, lowercase form from the expression in the string.
|
|
22
|
-
# underscore will also change ’::’ to ’/’ to convert namespaces to paths.
|
|
22
|
+
# underscore will also change ’::’ to ’/’ to convert namespaces to paths.
|
|
23
23
|
# This should implement the same functionality as underscore method in
|
|
24
24
|
# ActiveSupport::CoreExtensions::String::Inflections
|
|
25
25
|
def wmi_underscore
|
data/lib/ohai/plugin_config.rb
CHANGED
data/lib/ohai/plugins/aix/cpu.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Author:: Joshua Timberman <joshua@
|
|
2
|
+
# Author:: Joshua Timberman <joshua@chef.io>
|
|
3
3
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
|
4
|
-
#
|
|
4
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
|
5
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
|
5
6
|
# License:: Apache License, Version 2.0
|
|
6
7
|
#
|
|
7
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -22,36 +23,41 @@ Ohai.plugin(:CPU) do
|
|
|
22
23
|
|
|
23
24
|
collect_data(:aix) do
|
|
24
25
|
cpu Mash.new
|
|
25
|
-
|
|
26
|
+
|
|
26
27
|
cpu[:total] = shell_out("pmcycles -m").stdout.lines.length
|
|
27
|
-
# At least one CPU will be available, but we'll wait to increment this later.
|
|
28
|
-
cpu[:available] = 0
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
cpu[
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
# The below is only relevent on an LPAR
|
|
30
|
+
if shell_out('uname -W').stdout.strip == "0"
|
|
31
|
+
|
|
32
|
+
# At least one CPU will be available, but we'll wait to increment this later.
|
|
33
|
+
cpu[:available] = 0
|
|
34
|
+
|
|
35
|
+
cpudevs = shell_out("lsdev -Cc processor").stdout.lines
|
|
36
|
+
#from http://www-01.ibm.com/software/passportadvantage/pvu_terminology_for_customers.html
|
|
37
|
+
#on AIX number of cores and processors are considered same
|
|
38
|
+
cpu[:real] = cpu[:cores] = cpudevs.length
|
|
39
|
+
cpudevs.each.with_index do |c,i|
|
|
40
|
+
name, status, location = c.split
|
|
41
|
+
index = i.to_s
|
|
42
|
+
cpu[index] = Mash.new
|
|
43
|
+
cpu[index][:status] = status
|
|
44
|
+
cpu[index][:location] = location
|
|
45
|
+
if status =~ /Available/
|
|
46
|
+
cpu[:available] += 1
|
|
47
|
+
lsattr = shell_out("lsattr -El #{name}").stdout.lines
|
|
48
|
+
lsattr.each do |attribute|
|
|
49
|
+
attrib, value = attribute.split
|
|
50
|
+
if attrib == "type"
|
|
51
|
+
cpu[index][:model_name] = value
|
|
52
|
+
elsif attrib == "frequency"
|
|
53
|
+
cpu[index][:mhz] = value.to_i / (1000 * 1000) #convert from hz to MHz
|
|
54
|
+
else
|
|
55
|
+
cpu[index][attrib] = value
|
|
56
|
+
end
|
|
51
57
|
end
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
# IBM is the only maker of CPUs for AIX systems.
|
|
59
|
+
cpu[index][:vendor_id] = "IBM"
|
|
60
|
+
end
|
|
55
61
|
end
|
|
56
62
|
end
|
|
57
63
|
end
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Deepali Jagtap (<deepali.jagtap@clogeny.com>)
|
|
3
3
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
|
4
|
-
#
|
|
4
|
+
# Author:: Isa Farnik (<isa@chef.io>)
|
|
5
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
|
5
6
|
# License:: Apache License, Version 2.0
|
|
6
7
|
#
|
|
7
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -21,52 +22,69 @@
|
|
|
21
22
|
Ohai.plugin(:Filesystem) do
|
|
22
23
|
provides "filesystem"
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
def parse_df_or_mount(shell_out)
|
|
26
|
+
oldie = Mash.new
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
so.stdout.lines.each do |line|
|
|
28
|
+
shell_out.lines.each do |line|
|
|
29
|
+
fields = line.split
|
|
30
30
|
case line
|
|
31
|
-
|
|
31
|
+
# headers and horizontal rules to skip
|
|
32
|
+
when /^\s*(node|---|^Filesystem\s+1024-blocks)/
|
|
32
33
|
next
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
# strictly a df entry
|
|
35
|
+
when /^(.+?)\s+([0-9-]+)\s+([0-9-]+)\s+([0-9-]+)\s+([0-9-]+\%*)\s+(.+)$/
|
|
36
|
+
if $1 == "Global"
|
|
37
|
+
key = "#{$1}:#{$6}"
|
|
38
|
+
else
|
|
39
|
+
key = $1
|
|
40
|
+
end
|
|
41
|
+
oldie[key] ||= Mash.new
|
|
42
|
+
oldie[key][:kb_size] = $2
|
|
43
|
+
oldie[key][:kb_used] = $3
|
|
44
|
+
oldie[key][:kb_available] = $4
|
|
45
|
+
oldie[key][:percent_used] = $5
|
|
46
|
+
oldie[key][:mount] = $6
|
|
47
|
+
# an entry starting with 'G' or / (E.G. /tmp or /var)
|
|
48
|
+
when /^\s*(G.*?|\/\w)/
|
|
49
|
+
if fields[0] == "Global"
|
|
50
|
+
key = fields[0] + ":" + fields[1]
|
|
51
|
+
else
|
|
52
|
+
key = fields[0]
|
|
53
|
+
end
|
|
54
|
+
oldie[key] ||= Mash.new
|
|
55
|
+
oldie[key][:mount] = fields[1]
|
|
56
|
+
oldie[key][:fs_type] = fields[2]
|
|
57
|
+
oldie[key][:mount_options] = fields[6].split(',')
|
|
58
|
+
# entries occupying the 'Node' column parsed here
|
|
59
|
+
else
|
|
60
|
+
key = fields[0] + ":" + fields[1]
|
|
61
|
+
oldie[key] ||= Mash.new
|
|
62
|
+
oldie[key][:mount] = fields[1]
|
|
63
|
+
oldie[key][:fs_type] = fields[3]
|
|
64
|
+
oldie[key][:mount_options] = fields[7].split(',')
|
|
41
65
|
end
|
|
42
66
|
end
|
|
67
|
+
oldie
|
|
68
|
+
end
|
|
43
69
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
when /^\s*---/
|
|
51
|
-
next
|
|
52
|
-
when /^\s*\/\w/
|
|
53
|
-
fields = line.split
|
|
54
|
-
filesystem = fields[0]
|
|
55
|
-
fs[filesystem] = Mash.new unless fs.has_key?(filesystem)
|
|
56
|
-
fs[filesystem][:mount] = fields[1]
|
|
57
|
-
fs[filesystem][:fs_type] = fields[2]
|
|
58
|
-
fs[filesystem][:mount_options] = fields[6]
|
|
59
|
-
else
|
|
60
|
-
fields = line.split
|
|
61
|
-
filesystem = fields[0] + ":" + fields[1]
|
|
62
|
-
fs[filesystem] = Mash.new unless fs.has_key?(filesystem)
|
|
63
|
-
fs[filesystem][:mount] = fields[2]
|
|
64
|
-
fs[filesystem][:fs_type] = fields[3]
|
|
65
|
-
fs[filesystem][:mount_options] = fields[7]
|
|
66
|
-
end
|
|
70
|
+
def collect_old_version(shell_outs)
|
|
71
|
+
mount_hash = parse_df_or_mount shell_outs[:mount]
|
|
72
|
+
df_hash = parse_df_or_mount shell_outs[:df_Pk]
|
|
73
|
+
|
|
74
|
+
mount_hash.each do |key, hash|
|
|
75
|
+
df_hash[key].merge!(hash) if df_hash.has_key?(key)
|
|
67
76
|
end
|
|
68
77
|
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
mount_hash.merge(df_hash)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
collect_data(:aix) do
|
|
82
|
+
|
|
83
|
+
# Cache the command output
|
|
84
|
+
shell_outs = Mash.new
|
|
85
|
+
shell_outs[:mount] = shell_out("mount").stdout
|
|
86
|
+
shell_outs[:df_Pk] = shell_out("df -Pk").stdout
|
|
87
|
+
|
|
88
|
+
filesystem collect_old_version(shell_outs)
|
|
71
89
|
end
|
|
72
90
|
end
|