[Check_mk (english)] Host inventory with nested tables and JSON

Hi,

  we are trying to integrate check_mk inventory function to our CMDB.

  This works well for most part, but we have a problem with nested tables.

  We have created a view that has columns

Host, Alias, IPv4addr, Version, Model.

  For a stand-alone switch, this works fine, we get the following:

[
  "<hostname>",
  "<alias>",
  "<ipv4addr>,
  "15.2(2)E7",
  "WS-C2960C-12PC-L",
],

  However, for a switch stack, the "model" is empty. The information is visible in System => Physical components => Chassis and quite readable from the web UI.

  Fine, we add that column to the view. For a stack switch, we now get the following (other fields as before, sixth field is the chassis info):

[
  "<hostname>",
  "<alias>",
  "<ipv4addr>",
  "15.2(2)E7",
  "",
  "Open this table for filtering / sortingIndexNameDescriptionSoftwareSerial Num
berManufacturerModel NameLocation20012WS-C2960X-24PS-L15.2(2)E<serial>WS-C29
60X-24PS-LStack (1)10011WS-C2960X-24PS-L15.2(2)E<serial>WS-C2960X-24PS-LStac
k (1)"
],

  In CMK Web UI, the information is visible in a readable fashion. However, the JSON output of a "nested table" is not really easy to read as it apparently contains headers and has just concatenated all the data into one big string.

We fetch the JSON with

curl http://localhost/master/check_mk/view.py?view_name=osversions&output_format=json&_username=xxxxx&_secret=asdfasdfasdf

Other output_formats, such as python, also have this problem.

Any idea how to get the web API to output nested inventory information in a sensible fashion?

···

--
- Dr. Antti Mäkelä | Senior Architect | CCIE #20962 -
- Vintor Oy, Itsehallintokuja 6, 02600 Espoo | www.vintor.fi -