mirror of
https://github.com/FAUSheppy/icinga-webhook-gateway
synced 2025-12-06 15:31:38 +01:00
clarify info & status field in submitted json
This commit is contained in:
@@ -17,19 +17,20 @@ Services are configured in *services.json* as objects like this:
|
|||||||
}
|
}
|
||||||
|
|
||||||
## Client Requests
|
## Client Requests
|
||||||
Client must send a *POST-request* with *Content-Type: application/json* containing the service name and secret token as fields.
|
Client must send a *POST-request* with *Content-Type: application/json* containing the service name, secret token and status as fields, the *'info'* field is optional.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "application/json" \
|
-H "application/json" \
|
||||||
-d "{ "service_name" : "name", "token" : "secret_token" } \
|
-d "{ "service_name" : "name", "token" : "secret_token", "status" : "OK|WARNING|CRITICAL", "info" : "additional information" } \
|
||||||
https://server:port/
|
https://server:port/
|
||||||
|
|
||||||
Or directly in native python:
|
Or directly in native python:
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
requests.post("https://server:port/", json={"service_name" : "name", "token" : "secret_token" })
|
requests.post("https://server:port/", json={"service_name" : "name", "token" : "secret_token",
|
||||||
|
"status" : "OK|WARNING|CRITICAL", "info" : "additional information" })
|
||||||
|
|
||||||
## Icinga (Serverside) Requests
|
## Icinga (Serverside) Requests
|
||||||
Use the [python-script]() as a command to execute, you can pass *protocol*, *host*, *port* and *service\_name* as arguments.
|
Use the [python-script]() as a command to execute, you can pass *protocol*, *host*, *port* and *service\_name* as arguments.
|
||||||
|
|||||||
Reference in New Issue
Block a user