Hi Everyone,
I am working with the HTTP XML/REST sensor to get the number of tickets from our ticketing system.
I have tested it with two different tools and attempted to get the sensor working in PRTG
On one tool (SOAPui) it works fine - returns the JSON
{
"@count": 12,
"@start": 1,
"@totalcount": 12,
"Messages": [],
"ResourceName": "Incident",
"ReturnCode": 0,
"content": [
{"Incident": {"IncidentID": "IM10214"}},
{"Incident": {"IncidentID": "IM10215"}},
{"Incident": {"IncidentID": "IM10217"}},
{"Incident": {"IncidentID": "IM10218"}},
{"Incident": {"IncidentID": "IM10220"}},
{"Incident": {"IncidentID": "IM10223"}},
{"Incident": {"IncidentID": "IM10224"}},
{"Incident": {"IncidentID": "IM10227"}},
{"Incident": {"IncidentID": "IM10229"}},
{"Incident": {"IncidentID": "IM10230"}},
{"Incident": {"IncidentID": "IM10231"}},
{"Incident": {"IncidentID": "IM10234"}}
]
}
On XML/REST Sensor Query Builder - returns a 401 error for authentication
On PRTG it returns Warning: "server/path -n=nodename"
All three of these have been configure with the exact same settings.
Any suggestions on what to do next?
Article Comments
Hi @Stephan
All I am trying to do, for now, is get the "@totalcount" of incidents which represents all open incidents in the system.
Cheers
Dec, 2016 - Permalink
Using //IncidentID
in combination with Use the number of occurrences of the selected XML node or its children/siblings is probably the easier approach here. As bonus, use this as custom message:
There are %1 incidents in the ticket system.
Dec, 2016 - Permalink
Thanks @Stephan,
I gave that a try over using the @totalcount - replaced it with IncidentID and selected the Use the number of occurrences of the selected XML node or its children/siblings.
However; I am still encountering the same error of: server/path -n=nodename when I start up the sensor.
Dec, 2016 - Permalink
Argh, my string got messed up. Please try
//IncidentID
...for the XML Node. Does that one work? :)
Dec, 2016 - Permalink
Hi @Stephan,
Gave the change a shot with IncidentID, still no success, same error as before: server/path -n=nodename
Dec, 2016 - Permalink
Hi Evan,
I have placed the json content on our website for testing.
Using URL http://prtgtoolsfamily.com/KB72351.json
and XML Node @totalcount
Gives me 12:Node @totalcount holds value 12.
Dec, 2016 - Permalink
I think the URL is kind of messed up - what URL do you enter within the browser when you access this page? Especially the angled brackets make me wonder if this works in the first place... :)
Dec, 2016 - Permalink
@Stephan,
Thanks for pointing that out. I tried it without the two "<" and ">" and it is now working!
Side note: the original URL I was using worked in the SOAPui tool, so I assumed it must be part of the RestAPI for the Web Service.
Thanks!
Dec, 2016 - Permalink
What actual values do you want to retrieve here? All incident IDs?
Dec, 2016 - Permalink