Retrieve the right Agent Hash by Hostname from API

Hi,

for automatic host and agent registration we need a possibility to retrieve the latest agent’s hash by passing in a hostname via REST API.

The API endpoint

https://host/instance/check_mk/api/v0/domain-types/agent/collections/all

delivers a list of all existing Agent Hashes though, but apparantly there’s no way of getting the related hosts per agent hash.

Alternatively, our demand would also be resolved by extending the above noted request’s response to deliver all host names per agent hash, as well.

Thank you very much in advance and best regards,

Florian Grummel

Component/s

Rest & Web API

Current CheckMK Version/s

2.0.0p16

1 Like

It is a known issue that you cannot download an agent package without its hash value. Which you do not know beforehand and which you cannot retrieve only knowing the hostname.

See Use REST API for automatic agent deployment - #2 by r.sander