graylog-labs / check-graylog2-stream

Icinga/Nagios check to monitor Graylog2 stream alerts
Apache License 2.0
15 stars 11 forks source link

UNKNOWN: Can not parse JSON from Graylog2 API #2

Closed AndyMeusel closed 9 years ago

AndyMeusel commented 9 years ago

Hi,

I am experiencing an error when the plugin attempts to parse graylog2's stream, i have checked and the JSON string appears to be valid, strangely it did appear to work perfectly for a few iterations, i have tried binning the alert, then stream and the input but the error now always persists

{"creator_user_id":"AMeusel","outputs":[],"alert_receivers":{"users":[]},"description":"ALX-SW001","created_at":"2015-07-13T13:23:37.231Z","disabled":false,"rules":[{"field":"source","stream_id":"55a3bbd9e4b079bb0768e773","id":"55a3bbf3e4b079bb0768e78f","type":1,"inverted":false,"value":"alx-sw001.dhcp"}],"alert_conditions":[{"creator_user_id":"AMeusel","created_at":"2015-07-13T14:56:55.602Z","id":"026c19a7-56aa-4276-bd41-a2110e51c625","type":"message_count","parameters":{"grace":1,"threshold":0,"threshold_type":"more","backlog":0,"time":1}}],"id":"55a3bbd9e4b079bb0768e773","title":"ALX-SW001","content_pack":null}
AndyMeusel commented 9 years ago

Resolved :confused: somehow

crsprsp commented 7 years ago

Great answer my dear! And now please tell me how?

THX

AndyMeusel commented 7 years ago

Sorry @crsprsp, i take full responsibility for my shoddy closing comment, unfortunaetly this was 2 years ago and the code is now defunct, i can suggest that our end result was to use "The Dude" by Mikrotik instead: https://www.mikrotik.com/thedude

Sorry

ankush-grover-3pg commented 6 years ago

One reason can be the self sign certificate used on the server as I am getting the same error message. Tried the curl command and it says use -k (--insecure) method to connect to the server. Presently, I do not know which flag to use with check-graylog2-stream plugin to avoid or ignore self sign certificate error. Using -k flag with curl command works.

mariussturm commented 6 years ago

@ankush-grover-3pg the 'insecure' option is enabled by default in this check plugin: https://github.com/graylog-labs/check-graylog2-stream/blob/master/src/check-graylog2-stream/check-graylog2-stream.go#L88 so self-signed certs should be no problem.