CFEngine Inventory

29 views
Skip to first unread message

Shane Ripley

unread,
Jul 9, 2021, 2:31:07 PM7/9/21
to help-cfengine
Greetings, I'm seeing a couple of errors from the CFE inventory policy:

   error: Failed to chdir into '/var/cfengine/cmdb'. (chdir: 'No such file or directory')
   error: Can't stat file 'me.json' on '10.112.0.63' in files.copy_from promise
   error: Method 'cfe_autorun_inventory_cmdb' failed in some repairs\

/var/cfengne/cmdb doesn't exist in the community RPM packages, which seems like it should if its important, or at least the inventory code should create it if missing?

Also, what is the structure of me.json? I can't find any info in the docs about what it should contain.

Is the inventory policy useful in the community version or is this only meant to be for Enterprise? If I completely disable it, i.e remove it from promises.cf will I be breaking some other functionality?

Nick Anderson

unread,
Jul 13, 2021, 5:15:00 PM7/13/21
to Shane Ripley, help-cfengine

Shane Ripley <srip...@gmail.com> writes:

Hi Shane,

Greetings, I'm seeing a couple of errors from the CFE inventory policy:

error: Failed to chdir into '/var/cfengine/cmdb'. (chdir: 'No such file or directory') error: Can't stat file 'me.json' on '10.112.0.63' in files.copy_from promise error: Method 'cfe_autorun_inventory_cmdb' failed in some repairs\

/var/cfengne/cmdb doesn't exist in the community RPM packages, which seems like it should if its important, or at least the inventory code should create it if missing?

Ah, looking at this, I am surprised that it wasn't throwing errors previously. No matter, this should have been removed. I opened CFE-3712 and will open a pull request to remove the related policy shortly.

Thanks for asking about it.

Also, what is the structure of me.json? I can't find any info in the docs about what it should contain.

The docs for that can be found here (but it will disappear after the related changes are merged).

It's structure was similar to that of Augments, a JSON formatted file with top level keys for classes and vars.

Is the inventory policy useful in the community version or is this only meant to be for Enterprise? If I completely disable it, i.e remove it from promises.cf will I be breaking some other functionality?

Yes, I think that inventory policy is useful, even in the community version, though it's much more useful when you have Enterprise reporting and you can query for this information from a central place. There are various variables and classes that get defined that you might want to re-use from your own policy or perhaps to construct a report like the one used by cf-agent -b host_info_report.

Nothing should break if you decide to completely remove it.

Reply all
Reply to author
Forward
0 new messages