I´m using Check_MK and i was trying to implement a python script to run via cfengine to add automatically new installed hosts. I´m having some trouble with both using pycurl or running and external curl.
An example of the command i want to be able to pycurl is:
curl "http://10.20.30.40/mysite/check_mk/webapi.py?action=add_host&_username=autouser&_secret=mysecret" -d 'request={"attributes":{"alias": "Alias of winxp_1", "tag_agent": "cmk-agent", "tag_criticality": "prod", "ipaddress": "127.0.0.1"}, "hostname": "winxp_1", "folder": "os/windows"}'
This works fine from the terminal
but I cannot find the right syntax to make it working from within the python script.
thanks for any help.