new check_XML functionality help please

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
curlypete
Posts: 2
Joined: Wed Aug 15, 2018 6:16 am

new check_XML functionality help please

Post by curlypete »

Hi all,
I have been trying to get the new Check_XML wizard to work with pulling information out of a firewall API

the URL I have on a HTTPS page returns this in a browser
<response status="success">
<result>
<Gateway>
<name>VPN-Gateway</name>
<CurrentUsers>55</CurrentUsers>
<PreviousUsers>933</PreviousUsers>
</Gateway>
<TotalCurrentUsers>55</TotalCurrentUsers>
<TotalPreviousUsers>933</TotalPreviousUsers>
</result>
</response>

after running the wizard it -u 'https://URL' -k '/result/Gateway/CurrentUsers' -w 1900 -c 1950

The Run check command says:
UNKNOWN - Could not find the key or the value is not numeric

I think the way I put the syntax for drilling into the XML tree needs to be different from '/result/Gateway/CurrentUsers'

I have tried with Square brackets around each level, with double quotes etc...
Could anyone point out what I am doing wrong please?

The tooltip isn't great as it assumes I have more coding knowledge (And time on my hands to fill in the gaps)
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: new check_XML functionality help please

Post by cdienger »

Try:

Code: Select all

./check_xml.php -u http://url -k result[Gateway][CurrentUsers] -w 1900 -c 1950
This does deserve better examples and documentation. We'll look into that.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
curlypete
Posts: 2
Joined: Wed Aug 15, 2018 6:16 am

Re: new check_XML functionality help please

Post by curlypete »

Thank you
I can confirm your syntax has worked fine for me now
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: new check_XML functionality help please

Post by scottwilkerson »

curlypete wrote:Thank you
I can confirm your syntax has worked fine for me now
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked