Check_mk 1.6 Assign label via Api-http

Hi,

In the official documentation there are many examples of using the Api_http.

Link: [https://checkmk.com/cms_web_api_references.html#add_host].

But i don’t see nothing for assign label. Is possible?

thx
Dario.

try first get_host to see the structure then you can add the label easily to the add_host command… I still use 1.5 so I cant give you the solution :frowning:

https://checkmk.com/cms_web_api_references.html#get_host

2 Likes

Hi neeloj,

I hadn’t thought about a get_host. thank you :slight_smile: .

I’ll leave an example:

curl “http://…” -d 'request={“hostname”:“hostname”,“folder”:“destination_folder”,"attributes":{"… “labels”: {“key”: “value”}, “ipaddress”: “ipaddress”,“tag_agent”:“tag_agent”}}’

Dario.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.