Hi all
I’m trying to get scripts executed via API on a remote Host (Agent Based). The Intend is to execute Scripts on Request.
I created a command definition:
//###################### TEST REMOTE COMMAND ############################
object CheckCommand “remote_command_execute” {
import “plugin-check-command”
command = [ PluginDir + “/remote_command.sh” ]
}
This is the API Command I use:
curl -k -s -S -i -u USER:PW -H ‘Accept: application/json’ -X POST ‘https://localhost:5665/v1/actions/execute-command’ -d ‘{“type”: “Service”, “service”: “DUMMYSERVICE”, “ttl”: 15, “macros”: { “command_endpoint”: “SERVERNAME” }, “command”: “remote_command_execute”, “command_type”: “CheckCommand” }’
Unfortunately I get following Error:
HTTP/1.1 404 Not Found
Content-Type: application/json
Transfer-Encoding: chunked
Server: Icinga/r2.10.5-1
Did anybody do this already and can give me a hint ? Can I debug what exactly is missing or wrong in the API Request ? Where to find the issue?
Many Thanks in advance