jasonmcintosh / rabbitmq-zabbix

Zabbix RabbitMQ Configuration
Apache License 2.0
251 stars 168 forks source link

Constantly signal that RabbitMQ is dead #81

Closed darksmoke closed 6 years ago

darksmoke commented 6 years ago

Hi Constantly signal that RabbitMQ is dead all other data come login and password are correct

/opt/zabbix/bin/zabbix_get -s localhost -p 10050 -k "rabbitmq[check_aliveness]" Traceback (most recent call last): File "./api.py", line 285, in main() File "./api.py", line 274, in main print api.check_aliveness() File "./api.py", line 197, in check_aliveness return self.call_api('aliveness-test/%2f')['status'] File "./api.py", line 37, in call_api return json.loads(urllib2.build_opener(handler).open(url).read()) File "/usr/lib64/python2.7/urllib2.py", line 437, in open response = meth(req, response) File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib64/python2.7/urllib2.py", line 469, in error result = self._call_chain(args) File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain result = func(args) File "/usr/lib64/python2.7/urllib2.py", line 926, in http_error_401 url, req, headers) File "/usr/lib64/python2.7/urllib2.py", line 901, in http_error_auth_reqed response = self.retry_http_basic_auth(host, req, realm) File "/usr/lib64/python2.7/urllib2.py", line 914, in retry_http_basic_auth return self.parent.open(req, timeout=req.timeout) File "/usr/lib64/python2.7/urllib2.py", line 437, in open response = meth(req, response) File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib64/python2.7/urllib2.py", line 475, in error return self._call_chain(args) File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain result = func(args) File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 401: Unauthorized

jasonmcintosh commented 6 years ago

Your issue is there on the last line... HTTP Error 401: Unauthorized Should be a configuration/authorization issue. Whatever user you're using needs access to the aliveness queues. Check it against the API's to confirm.

darksmoke commented 6 years ago

/opt/zabbix/bin/zabbix_get -s localhost -p 10050 -k "rabbitmq[check_aliveness]"

Traceback (most recent call last): File "./api.py", line 285, in main() File "./api.py", line 274, in main print api.check_aliveness() File "./api.py", line 197, in check_aliveness return self.call_api('aliveness-test/%2f')['status'] File "./api.py", line 37, in call_api return json.loads(urllib2.build_opener(handler).open(url).read()) File "/usr/lib64/python2.7/urllib2.py", line 437, in open response = meth(req, response) File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib64/python2.7/urllib2.py", line 469, in error result = self._call_chain(args) File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain result = func(args) File "/usr/lib64/python2.7/urllib2.py", line 926, in http_error_401 url, req, headers) File "/usr/lib64/python2.7/urllib2.py", line 901, in http_error_auth_reqed response = self.retry_http_basic_auth(host, req, realm) File "/usr/lib64/python2.7/urllib2.py", line 914, in retry_http_basic_auth return self.parent.open(req, timeout=req.timeout) File "/usr/lib64/python2.7/urllib2.py", line 437, in open response = meth(req, response) File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib64/python2.7/urllib2.py", line 475, in error return self._call_chain(args) File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain result = func(args) File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request

darksmoke commented 6 years ago

Why?

jasonmcintosh commented 6 years ago

SO you should be able to replicate this by calling the API with your username/password. e.g. curl -u myuser:mypass http://127.0.0.1:15672/api/aliveness-test/%2F ALL this script does is call those endpoints. If you look at the above, it's trying to call that on aliveness-test/%2f

I'd GUESS the user you're using doesn't have access to the / vhost.

darksmoke commented 6 years ago

I get $ curl -u user:pass http://127.0.0.1:15672/api/aliveness-test/%2F {"error":"bad_request","reason":"406 PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'aliveness-test' in vhost '/': received 'false' but current is 'true'"}

jasonmcintosh commented 6 years ago

Delete the queue - you don't have to create it manually. Calling the API creates it automatically.

jasonmcintosh commented 6 years ago

Closing - if there's still an issue can re-open