-
Hello Thruk users, for an automation and lifecycle process I want to create and delete hosts and services inside of thruk via the REST API. The scripts are all based on curl and JSON. I can't find a way to create a host via the rest api. Tested already so many ways include the I already can get all data reading out of Thruk but the other way - no chance. Has anybody already created a new host/service via curl and JSON? So I have no more ideas. curl --insecure -s -S -X POST -H "Content-Type: application/json" -H "X-Thruk-Auth-User:omdadmin" -H "X-Thruk-Auth-Key:SECRETTOKEN" --data '{"host_name":"TESTHOST01"}' https:/host.domain.com/site/thruk/r/hosts/TESTHOST01/config I'm very very happy for a good idea! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You need to POST to /config/objects as described here: https://thruk.org/documentation/rest.html#_post-config-objects |
Beta Was this translation helpful? Give feedback.
-
when using & in the shell, you need to put it in quotes, otherwise the shell will interpret that as a background command.
|
Beta Was this translation helpful? Give feedback.
when using & in the shell, you need to put it in quotes, otherwise the shell will interpret that as a background command.
try something like this: