I'm running into some issues regarding the Custom Template Sensor Syntax, and saw this KB: https://helpdesk.paessler.com/en/support/solutions/articles/80514-create-channels-dynamically-based-on-json-objects
In it, Stephen Linke gives this JSONPath syntax as a way of dynamically creating sensors based on the Json result received from a device (reduced for clarity):
"value": { #1: $..({ @.servicegroupname : @.primaryport}).* }
I tried to go through the docs (https://www.paessler.com/manuals/prtg/rest_custom_sensor), but this syntax is still too confusing.
Can someone shed some light as to what this jsonpath does, and how it allows for the creation of channels in a dynamic fashion?
Thanks.
Basically, what this Sensor does, is that it iterates through the service groups of the JSON result and then creates a channel for each servicegroup and names it after the service group. #1 is always the current @.servicegroupname. I must admit, the Sensor is unfortunately rather complex, especially the automatic channel generation :(
Oct, 2020 - Permalink