I built a bit of automation using the old webapi and json views.
as the legacy API is being deprecated I’m trying to move towards to REST API, but I’ve discovered there may be some holes:
I REALLY would like to see all the status/views all be exposed via the REST API, but I digress:
As of 2.2 how would I get the equivilant of this legacy query?
/check_mk/webapi.py?action=get_hosttags&_username=automation&_secret=automationsecret&request_format=json&output_format=json
I use that to populate a knowledge graph with all the possible Nodetypes, hostgroup tags, criticality tags, etc etc…
I’m not sure the best way to get that data via an automation web query in the newer versions.
Hi,
you can create a view with all columns you need. Then click on Display > This page without nagivation to get a nice URL. You can add &_username=...&_secret=_...&output_format=....&display_options=t to this URL.
Couldn’t find it in the documentation. At your suggestion I tried:
/check_mk/api/v0/domain-types/host_tag/collections/all
no dice.
There is a host_tag_groups - which ONLY gives you the list of host tag groups, but not the available individual host tag options FOR those groups…
or am I missing something?
kdeutsch - I was hoping to avoid a CUSTOM view so this would work across implementations.
I have used custom views before - but would prefer a proper webapi call that would consistantly work (theoretically) with any modern checkMK implementation.
Thanks!
FYI - I’m working on an Apache Hop pipeline/workflow that ingests checkmk data into a neo4j knowledgegraph so I can built other automation workflows based on the data.
The documentation says I should get a “members” array - but it isn’t present - so I get a list of the host groups, but not WHICH HOSTS are members. Also the hostgroup setting isn’t present on the query:
domain-types/host_config/collections/all
This seems odd that I can’t get the same data in these REST API queries that I got from the legacy webapi - much of that data simply isn’t available.
If the webapi.py is being deprecated, we should be able to get the SAME data from the REST API before it is removed: http://checkmkserver/check_mk/webapi.py?action=get_all_hosts gives me many pieces of data missing from domain-types/host_config/collections/all
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.