Hello,
I'm looking to create a sensor to map the channel name dynamically with a value from json.
My API send :
{ "application": [ { "applicationName": "App1", "applicationParameters": [ { "name": "connectCurrent", "count": 0, }, { "name": "connectMax", "count": 10 } ] }, { "applicationName": "App3", "applicationParameters": [ { "name": "connectCurrent", "count": 2, }, { "name": "connectMax", "count": 10 } ] }, { "applicationName": "App3", "applicationParameters": [ { "name": "connectCurrent", "count": 0, }, { "name": "connectMax", "count": 200 } ] } ] }
I need to have on PRTG : I need to have:
- App1 - connectCurrent
- App1 - connectMax
- App2 - connectCurrent
- App2 - connectMax
- ...
If I add an App4 I need PRTG to add the channel dynamically.
I can do this sensor manually via REST Custom BETA:
{ "prtg":{ "description":{ "device":"http://127.0.0.1", "query":"/getApp" }, "result":[ { "channel":$.application[0].applicationParameters[0].name, "value":$.application[0].applicationParameters.count, "float":1, "decimalmode":"Auto", "unit":"custom", "customunit":"C" } ], } }
Is it possible to do a foreach to match the Channel Name with a value ? Or another method, but I don't see how to do it?
Thank you!
Add comment