From be6f36e6090028222db76e4929124e7b55b4e4df Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Thu, 6 Jan 2022 11:53:59 +0100 Subject: [PATCH] clarify info & status field in submitted json --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d950c9b..92e98eb 100644 --- a/README.md +++ b/README.md @@ -17,19 +17,20 @@ Services are configured in *services.json* as objects like this: } ## 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: curl -X POST \ -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/ Or directly in native python: 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 Use the [python-script]() as a command to execute, you can pass *protocol*, *host*, *port* and *service\_name* as arguments.