xWyatt / check_rest_api

Nagios Core plugin to check output from a RESTful JSON API
GNU General Public License v3.0
10 stars 5 forks source link

-K fails to match when JSON is enclosed in '[]' brackets #26

Open eap-nutanix opened 1 year ago

eap-nutanix commented 1 year ago

(warning, I don't claim to actually know what I'm doing)

I've observed that if the JSON returned by an API call is enclosed in '[]' brackets (i.e. ordered-list format), the jsonKey search fails. If it encounters '{}' (key-value pairs), then it works fine.

This is a very helpful plugin - I'm using it to monitor Arista CCF SDN switches, as neither SNMP nor syslog contains the value we are looking for.

michaje-gsc commented 2 months ago

Same issue here. It would be great to have a fix that includes a syntax for the -K option and allows to navigate within arrays.