The easiest way to replicate is via the Swagger REST-API Interactive GUI, using the method Show Configuration of a single agent (GET /objects/agent/{agent_hash})
This replicates exactly what I see in my code. ie
curl -X 'GET' \
'https://10.241.155.25/cmkpoc/check_mk/api/2.1/objects/agent/77598026718eb360' \
-H 'accept: application/json'
https://10.241.155.25/cmkpoc/check_mk/api/2.1/objects/agent/77598026718eb360
{
"title": "Internal Server Error",
"status": 500,
"detail": "Permission mismatch. See the server logs for more information."
}
Hi Mark, looks like I can reproduce this, I will open a ticket.
Can you try to use the hostname in the meantime? That should be more real-worldly anyway.
Hi @robin.gierse ,
Ok thats great thank you.
Unfortunately I cant use hostname as I am trying to get a list of hostnames that are associated with a particulate build. I am assuming/hoping that is what will be in the ‘members’ list attribute when this works properly.
But you are aware, that hashes change on each baking? Of course as long as the configuration does not change, the hash stays the same, but when it changes, the hash also changes.
It sounds like you are trying to work around an issue, but you are not on the best path for a solution.
I have a script that along with Ansible used as a deployment method allows us to deploy to our Linux servers that run the agent as non-root, while still using the agent bakery to maintain and modify agents and agent configurations. The script runs daily and extracts the builds, it also maintains the relationship between the build hash and the hosts that are associated with that build, hence the need for this particular get method to work.
If you feel there is a better way of doing this, then I would be happy to hear any suggestions. As far as I am aware the agent bakery cannot be used in a non-root agent setup.(ie the agent registration with the bakery requires root permissions)
Wow, that is a sophisticated use case right there. Keep doing what you do, you seem to know your way around Checkmk and understand how things work.
Keep an eye on the Werks for the fix of your problem. But I cannot promise any timeline. If you can, open a support ticket with us, that might speed things up.
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.