Followed your advice.
While the plugin was executed, my clause
’if platform.eql?(“aix”) or platform_family.eql?(“aix”)'
prevented the execution of my code because I wrongly required ‘require_plugin(“platform_family)”’,
which is valid on ohai 7 but not on ohai 6, instead of ‘require_plugin(“platform)”’.
The wrong ‘require_plugin’ had no adverse effect when running ohai
from the command line whereas it did prevent my code from executing when
run as part of a chef-client run. Hence, my false conclusion that results
are not reported back.
Problem solved, thanks for your help!
Daniel DeLeo <firstname.lastname@example.org>
[chef] Re: Ohai
custom plugin results not reported back to Chef server
On Tuesday, May 27, 2014 at 5:48 AM, Reto Hermann wrote:
> I am experimenting with chef-client version 11.10.0.rc.1 on AIX 6.1.
> I have written an Ohai 7 plugin and therefore upgraded Ohai on the
AIX box to version 7.0.4 (using gem install ohai). When running ohai from
the command line, the plugin works fine as expected.
> I have added the ohai cookbook to the run_list of the AIX client node.
Executing a chef-client run from the command line does not produce any
warning nor error messages. However, the attributes collected by my custom
plugin do not show up in the node view on the Chef server webui nor are
they searchable from the command line using knife.
> Are Ohai custom plugins supported by chef-client version 11.10.0.rc.1?
> Is the problem I am seeing possibly caused by using Ohai 7 with chef-client
> Where should I look for evidence what’s going wrong?
> Thanks for any advice!
Try running chef-client with
-ldebug to see messages from ohai, and check
if your plugin is actually running at all. It could be a configuration
issue where your plugin is not getting picked up by ohai when chef-client
runs, or it could be failing for some reason when chef-client runs the
plugin (currently ohai’s design is to let plugins fail so that they don’t
have to be defensively coded, but this makes it tricky to debug when a
plugin that isn’t supposed to fail does fail).