difficulty having check_xml.php match a string value
Posted: Tue Feb 09, 2021 4:43 pm
I'm trying to use check_xml.php to match a string value. Reading the php, I've figured out that keys are meant to be formatted as start[level][keyname].
This is how I'm executing the check:
This is a simplified version of the xml response being scraped:
The response I get is
I've done some debugging and find that it looks like maybe isset($current_arr[$key]) doesn't think bonder_status is set…or at least, having it print the $key it's checking before the check, checks bonder_status, but then never checks state.
I don't think I'm using this wrong, I've tried every format I can think of passing in the values. I don't seem to be able to find any examples of actually using check_xml.php this way and the documentation is as minimal as can be.
Anyone have any hints?
This is how I'm executing the check:
Code: Select all
php check_xml.php -u https://example.org/xml -k list-item[bonder_status][state] -s upCode: Select all
<?xml version="1.0" encoding="utf-8"?>
<root>
<list-item>
<id>5</id>
<tuning></tuning>
<bonder_status>
<state>up</state>
</bonder_status>
</list-item>
</root>
Code: Select all
CRITICAL - Value 'Array' did not match 'up'I don't think I'm using this wrong, I've tried every format I can think of passing in the values. I don't seem to be able to find any examples of actually using check_xml.php this way and the documentation is as minimal as can be.
Anyone have any hints?