I have this “interesting” problem while developing an inventory plugin “AIX_LVM_ALL”
where I want to enrich the inventory of AIX hosts with infos about their logical volumes and volume groups.
There’s a nice AIX command giving me the following output (with spaces in-between):
My problem now is that in some cases the “type” of a volume is empty as can be seen in line 4 above (“xxxlv_private3…”).
As a consequence the CheckMK gives me 6 entries instead of the expected 7 (because the delimiters are spaces).
I was wondering if somebody already had a similar problem and what their approach was?
My first rough idea would be to
- wrap above command in a python script on the host writing the raw result to some tmp first
- parse the sections,
- figure the distances and possible overflows,
- replacing with appropriate number of tabs
- and write out the enhanced
Any better ideas? Is there already some solution?