Page 1 of 1

new check_XML functionality help please

Posted: Wed Jul 15, 2020 1:22 pm
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)

Re: new check_XML functionality help please

Posted: Thu Jul 16, 2020 2:58 pm
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.

Re: new check_XML functionality help please

Posted: Fri Jul 17, 2020 3:26 am
by curlypete
Thank you
I can confirm your syntax has worked fine for me now

Re: new check_XML functionality help please

Posted: Fri Jul 17, 2020 7:51 am
by scottwilkerson
curlypete wrote:Thank you
I can confirm your syntax has worked fine for me now
Great!

Locking thread