Hi,
we want use the http API from Mailstore for monitoring. We tested the API with postman and get the answer:
{ "error": null, "token": null, "statusVersion": 2, "statusCode": "succeeded", "percentProgress": null, "statusText": null, "result": [ { "instanceID": "swr2021", "alias": "swr", "displayName": "Mailarchiv ", "instanceHost": "mailstore.test.de", "startMode": "automatic", "processID": 4492, "status": "running", "startStopError": null } ], "logOutput": null }
Now we want ask for the "status" in prtg. Template file:
{ "prtg": { "result": [ { "channel": "Test" , "value": lookup($.result.status, "running", "stopped") } ] } }
The value is a string, so we must convert it with lookup.
The prtg settings are:
- Post
- Post-Data: instanceFilter: swr2021
- HTTPS
- standard auth
- HTTP Header: Content-Type: application/x-www-form-urlencoded
- REST Request: :8474/api/invoke/GetInstances
But PRTG genereates an error: Could no evaluate channel value of Test: unsupported value type string for select, expected map[string]interface{} or []interface{}.
Add comment