ruby Ohaiを単体で使ってみる。参考号:https://wiki.opscode.com/display/chef/Ohai+Installation+and+Use

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby Ohaiを単体で使ってみる。参考号:https://wiki.opscode.com/display/chef/Ohai+Installation+and+Use相关的知识,希望对你有一定的参考价值。

require 'ohai'
require 'pp'

pp ohai = Ohai::System.new
pp ohai.all_plugins
pp ohai.seen_plugins
pp kernel = ohai.kernel
pp kernel.keys
pp kernel[:name]
pp kernel[:release]
pp kernel[:version]
#pp kernel[:modules]
pp kernel[:machine]
pp kernel[:os]

=begin
#<Ohai::System:0x007f06879412b0
 @data={},
 @hints={},
 @plugin_path="",
 @providers={},
 @seen_plugins={}>
true
{"os"=>true,
 "kernel"=>true,
 "ruby"=>true,
 "languages"=>true,
 "java"=>true,
 "ssh_host_key"=>true,
 "keys"=>true,
 "cloud"=>true,
 "ec2"=>true,
 "hostname"=>true,
 "linux::hostname"=>true,
 "network"=>true,
 "linux::network"=>true,
 "gce"=>true,
 "rackspace"=>true,
 "eucalyptus"=>true,
 "linode"=>true,
 "openstack"=>true,
 "azure"=>true,
 "dmi_common"=>true,
 "root_group"=>true,
 "c"=>true,
 "php"=>true,
 "network_listeners"=>true,
 "chef"=>true,
 "erlang"=>true,
 "ohai_time"=>true,
 "virtualization"=>true,
 "linux::virtualization"=>true,
 "nodejs"=>true,
 "ip_scopes"=>true,
 "lua"=>true,
 "dmi"=>true,
 "passwd"=>true,
 "platform"=>true,
 "linux::platform"=>true,
 "linux::lsb"=>true,
 "groovy"=>true,
 "mono"=>true,
 "python"=>true,
 "ohai"=>true,
 "command"=>true,
 "uptime"=>true,
 "perl"=>true,
 "linux::filesystem"=>true,
 "linux::memory"=>true,
 "linux::kernel"=>true,
 "linux::block_device"=>true,
 "linux::ps"=>true,
 "linux::cpu"=>true,
 "linux::uptime"=>true}
{"name"=>"Linux",
 "release"=>"3.11.0-15-generic",
 "version"=>"#25-Ubuntu SMP Thu Jan 30 17:22:01 UTC 2014",
 "machine"=>"x86_64",
 "modules"=>
  {"pci_stub"=>{"size"=>"12622", "refcount"=>"1"},
   ......
   "libahci"=>{"size"=>"31928", "refcount"=>"1"}},
 "os"=>"GNU/Linux"}
["name", "release", "version", "machine", "modules", "os"]
"Linux"
"3.11.0-15-generic"
"#25-Ubuntu SMP Thu Jan 30 17:22:01 UTC 2014"
"x86_64"
"GNU/Linux"
=end

以上是关于ruby Ohaiを単体で使ってみる。参考号:https://wiki.opscode.com/display/chef/Ohai+Installation+and+Use的主要内容,如果未能解决你的问题,请参考以下文章

csharp 【执笔中】コレクション内のデータに応じて的DataTemplateを切り替えたい场合にItemTemplateSelectorを使ってみる。

ruby 尝试使用实例方法Module#refineお试しでつかってみる。スコープを限定させてクラスのメソッドを改変·拡张するRef:http://www.ruby-doc.org/core

text 请求-HTMLを触ってみる

typescript nedb使ってみた

[转]使用STM32CubeMX:USB大容量存储设备

DTrace Oracle Database