drewkerrigan/nagios-http-json

Need help.

metabsd opened this issue · 2 comments

It's possible to handle that type of json response ?

./check_http_json.py -d -s -H test.service-now.com -p "/api/now/table/ecc_agent?sysparm_query=name=aname&sysparm_fields=status&sysparm_view=" -B "username:Passw0rd" -c "????"
url:https://test.service-now.com//api/now/table/ecc_agent?sysparm_query=name=aname&sysparm_fields=status&sysparm_view=
json:
{u'result': [{u'status': u'Up'}]}
rules:Namespace(auth='username:Passw0rd', data=None, debug=True, headers=None, host='test.service-now.com', key_list=None, key_list_critical=None, key_threshold_critical=['result.status,Up'], key_threshold_warning=None, key_value_list=None, key_value_list_critical=None, metric_list=None, path='/api/now/table/ecc_agent?sysparm_query=name=aname&sysparm_fields=status&sysparm_view=', port=None, separator=None, ssl=True, timeout=None)
separator:.
OK: Status OK.

The response of ServiceNOW is {u'result': [{u'status': u'Up'}]} and I want to setup critical if status is Up for testing.

Thank you!!!

{u'result': [{u'status': u'Up'}]} is invalid json.

If the response is: {"result": [{"status": "Up"}]} then -Q "result.(0).status,Up" should do the trick :-)

Closing this due to inactivity. Please reopen if this still is an issue