Werk #19981 · Nov 30, 26
HW/SW Inventory: Conversion command reports the trees of removed hosts and a summary
Since Checkmk 2.5.0, HW/SW Inventory trees are stored as JSON (werk #18032). A nightly cron job runs the following command to convert the trees that still use the previous file format (werk #18033):
cmk-transform-inventory-trees
This command had several flaws:
- The results listed under "Unknown file paths" the tree files that existing hosts did not have, whether such a file existed or not, but not the trees of hosts that no longer exist. They now list the trees of removed hosts under "Legacy trees of removed hosts". These trees are never converted. Ensure that these files are not connected to any host; only then can they be deleted.
- Archive and delta cache trees were converted again even if their JSON file already existed.
- If the host list could not be retrieved, the command continued with no hosts. It now stops with an error.
- Durations were rounded to two decimals, so most converted trees showed 0.00 seconds. They are now shown to the microsecond.
- The nightly job spread the conversion over 200 nights (werk #19379). It now finishes within 50 nights.
- Errors of the nightly job were lost unless an admin email address was
configured for the site. They are now written to
var/log/inventory-transformation.log, together with the number of converted trees per run. Each line starts with a timestamp. - The command exited with 0 even if single trees could not be converted. It now exits with 1.
To see the results, run as site user:
cmk-transform-inventory-trees --show-results
The results now end with a summary:
- the total number of tree files
- the numbers of JSON and of legacy files
- the number of legacy files left to convert
- the number of legacy files of removed hosts
- how long converting the others took
The summary always covers the whole site. The option --host-name only
selects the trees to convert:
cmk-transform-inventory-trees --host-name <HOST> [<HOST> ...]
To show the duration and size of every converted tree as well, run:
cmk-transform-inventory-trees --show-results --details
Details
- Class:
- Bug Fixes
- Level:
- Trivial
- Component:
- Inventory
- Versions:
- 3.0.0b1Not yet releasedAll Editions
- 2.5.0p24Not yet releasedAll Editions