Accessing and manipulating system information with Ohai
A vast amount of information from a given system is available to Chef through Ohai. This program is executed during each Chef run and stores all of the gathered information in the Chef database to make it available right from the cookbooks. The kind of information gathered by default is quite large.
It ranges from networking details—such as link speed, MTU, or addresses—to all the memory usage details you'd find on a utility such as top
, all of the imaginable data regarding filesystems or virtualization systems, or the list of every single installed package and logged-in users.
On top of this, Ohai is a modular system with a lot of community plugins to integrate Dell DRAC information with support information related to a KVM, LXC, or XenServer.
It can even be used to retrieve some specific data related to Windows Management Instrumentation (WMI). We obviously can write our own plugins, but that's way beyond the scope of this book.