Hi there,
i already build some custom sensors (templates) to monitor our cisco telepresence endpoints. All doing well except that one:
The expression filter doesn't work for me. With jsonpath.com my JSONPath Syntax looks ok and gave me the correct value.
The sensor in PRTG gave me this error: "Could no evaluate channel value of TouchPanel Status: expected type string for parameter 0 but got []interface {}."
Regarding the documention https://www.paessler.com/manuals/prtg/rest_custom_sensor
You can filter matches with [?<expression>]. This expression matches 35985021 in the example above because the first device is the only one with a beta channel: $.devices[[email protected]=="beta"].networks.a.rx_bytes ---
my jsonpath (working at http://jsonpath.com/ and http://www.jsonquerytool.com/#/JSONPath)
$.Status.Peripherals.ConnectedDevice[?(@.Type.Value=="TouchPanel")].Status I also tried without the () Doesn't work either.
Any hints?
Greetings from Berlin, Sebastian
Here my json output of the telepresence device
{ "Status":{ "Peripherals":{ "ConnectedDevice":[ { "id":"1004", "HardwareInfo":{ "Value":"102310-1" }, "ID":{ "Value":"xx:xx:xx:xx:xx:xx" }, "Name":{ "Value":"Cisco TelePresence Touch" }, "SoftwareInfo":{ "Value":"ce9.6.1.4516ae5aaa1" }, "Status":{ "Value":"Connected" }, "Type":{ "Value":"TouchPanel" }, "UpgradeStatus":{ "Value":"None" } }, { "id":"1016", "HardwareInfo":{ "Value":"iPhone10,4" }, "ID":{ "Value":"xxxxx" }, "Name":{ "Value":"iPhone8" }, "SoftwareInfo":{ "Value":"ios-2.0.3" }, "Status":{ "Value":"Connected" }, "Type":{ "Value":"Byod" }, "UpgradeStatus":{ "Value":"None" } } ] } } }
my template
{ "prtg": { "description" : { "device": "Cisco Telepresence Devices", "query": "/getxml?location=status/Peripherals/ConnectedDevice", "comment":"Shows peripheral devices that are currently connected to the endpoint. via Expression filtered if Type = TouchPanel show Status", }, "text": $.Status.Peripherals.ConnectedDevice[[email protected]=="TouchPanel"].Status, "result": [ { "channel": "TouchPanel Status", "value": lookup($.Status.Peripherals.ConnectedDevice[[email protected]=="TouchPanel"].Status, "ResponseTimedOut", "Connected", "Unpairing", "LostConnection") } ] } }
Add comment