Hey guys.
I would like help. I have an API where I want to collect the status. Contacting the return is a string, I am using the lookup but it is giving the error:
Could no evaluate channel value of Status: expected type string for parameter 0 but got []interface {}
Following is the complete Json return:
{
"http_method":"GET",
"results":[
{
"name":"LBVDC",
"ldap_server":"LDAPDomain",
"type":"fsso",
"status":"connected",
"active_server":"10.0.74.1"
},
{
"name":"Local FSSO Agent",
"ldap_server":"",
"type":"fsso",
"status":"connected",
"active_server":"127.0.0.1"
},
{
"id":1,
"server":"10.100.41.31",
"ldap_server":"LDAPBenef",
"type":"fsso-polling",
"status":"disconnected"
}
],
"vdom":"Internet",
"path":"user",
"name":"fsso",
"status":"success",
"serial":"FG5H0E3917902163",
"version":"v6.4.3",
"build":1778
}
Here is the template created:
{
"prtg": {
"result": [
{
"channel": "Status",
"value":lookup($.results[:1].status, "disconnected", "connected")
}
]
}
}
Rest API Custom Template using Lookup
Votes:
0
1 Reply
Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.
Add comment