• Overview
  • Deploying MCollective
  • Configuration / Deployment Topics
  • Use and Administer MCollective
  • Write Agent Plugins
  • Write Clients and Applications
  • Write Other Plugins
  • Plugin Directory
  • Internals
  • Older and Non-Recommended Information

MCollective Plugin: Ohai



The Ohai plugin enables mcollective to use OpsCode Ohai as a source for facts about your system.

This plugin uses a 3000 second cache for facts, after that it will reset Ohai and regenerate all the facts, this adds a few seconds or so overhead to discovery.

This plugin is released as Apache License v2 same as the license of Ohai.


If you are using MCollective 1.1.0 or newer you need the file opscodeohai_facts.rb. Otherwise, use opscodeohai.rb.

  • The source for the plugin is GitHub


You can set the following config options in the server.cfg

  • You have to set factsource = opscodeohai in server.cfg to tell it to load this plugin

If you have MCollective 1.0.x and older:

  • plugin.facter.cache_time - how long to cache for, defaults to 300

If you have Mcollective 1.1.x and newer:

  • fact_cache_time - how long to cache for, defaults to 300


You should now be able to do use all your ohai facts in discovery and fact reporting.

$ mc-facts platform_version
Report for fact: platform_version

        5.3                                     found 3 times
        5.4                                     found 10 times

Finished processing 13 hosts in 5007.51 ms

You can also use all these facts in your usual discovery lookups etc.

Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.