Ohai last modified timestamp


#1

Does anyone know if there is a parameter that indicates when an Ohai system profile was last modified? We are using Ohai data to feed an external CMDB system and would like to only trigger pushes if a Chef node has had a modification in its Ohai profile.

Thanks
George


#2

On Monday, May 11, 2015 at 10:41 AM, Vauter, George wrote:

Does anyone know if there is a parameter that indicates when an Ohai system profile was last modified? We are using Ohai data to feed an external CMDB system and would like to only trigger pushes if a Chef node has had a modification in its Ohai profile.

Ohai doesn’t keep any state about its previous run, and Chef Client discards the data that’s on the server at the beginning of the run. You can probably build something like this yourself by saving the ohai data to disk (either in a Chef Client run or out of band), but beware that Ohai picks up a lot of volatile data. A long while ago I wrote a tool to compare Ohai output to a baseline for the purpose of detecting regressions in Ohai itself, and I had to make a whitelist of all the volatile keys. You can see the list of them here (I think these are still valid, but may not be complete, especially on cloud platforms): https://github.com/chef/ohai-verifier/blob/master/spec/regression_spec.rb#L64-L107

Thanks
George

HTH,


Daniel DeLeo


#3

Thanks Daniel - this is great info!

  • George

On May 11, 2015, at 10:05 PM, Daniel DeLeo dan@kallistec.com wrote:

On Monday, May 11, 2015 at 10:41 AM, Vauter, George wrote:

Does anyone know if there is a parameter that indicates when an Ohai system profile was last modified? We are using Ohai data to feed an external CMDB system and would like to only trigger pushes if a Chef node has had a modification in its Ohai profile.

Ohai doesn’t keep any state about its previous run, and Chef Client discards the data that’s on the server at the beginning of the run. You can probably build something like this yourself by saving the ohai data to disk (either in a Chef Client run or out of band), but beware that Ohai picks up a lot of volatile data. A long while ago I wrote a tool to compare Ohai output to a baseline for the purpose of detecting regressions in Ohai itself, and I had to make a whitelist of all the volatile keys. You can see the list of them here (I think these are still valid, but may not be complete, especially on cloud platforms): https://github.com/chef/ohai-verifier/blob/master/spec/regression_spec.rb#L64-L107

Thanks
George

HTH,


Daniel DeLeo