You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
./check_http_json.py -H localhost:8000 -p bracket.json -q "(0).foobar,123"
OK: Status OK.
./check_http_json.py -H localhost:8000 -p bracket.json -q "(1).foo bar (foobar),123"
Traceback (most recent call last):
....
File "nagios-http-json/./check_http_json.py", line 111, in getSubArrayElement
index = int(key[key.find(self.arrayOpener) +
ValueError: invalid literal for int() with base 10: 'foobar'
Like you said it's the array detection, not sure if and how to fix that yet 🤔 any ideas are welcome.
Tested it a bit more, but I wouldn't call it a real solution just a workaround. Unittests are green but I don't wanna merge it yet.
If anyone needs this: Test the provided code and let me know.
Switching to jsonpath would really be the longterm way to fix issues like these.
We have a status, which contains a key like
"last data received (minutes)", i.e. the key string contains round brackets.
If i try to address this key, the array-selection mechanism kicks in. Can i somehow quote "(" and ")"?
The text was updated successfully, but these errors were encountered: