Hello,
We are using PRTG Version 17.4.33.3283+ and we have a lot of different websites we like to monitor with the REST Custom Sensor...
our websites response the health status in JSON like this but all with different services we like to check:
{"meta":{"status":["OK","NOK"],"statusCode":[0,-1]},"data":{"lastUpdated":"2018-04-30T06:53:32.962Z","overall":"OK","overallCode":0,"bundles":{"group":"OK","numTotal":242,"numActive":239,"numInstalled":0,"numResolved":3,"numFailure":0},"services":{"group":"OK","sismedia":"OK","solr":"OK","kachelmann":"OK","geotracks":"OK"}}}
so we did a JSON File in the custom file path to look for all services and convert the status from OK or NOK to 0 and 1
{ "prtg": { "result": [ { "channel": "Status" , "value": $.meta.statusCode }, { "channel": "Overall", "value": $.data.overallCode }, { "value": {lookup($.data.services.*, "OK", "NOK")} } ] } }
sadly , we get back an error could not load config: invalid character '$' looking for beginning of value
someone have an idea what we are doing wrong?
Thank you
Add comment