ZABBIX Forums  
  #1  
Old 25-10-2013, 22:09
mcintoshj mcintoshj is offline
Junior Member
 
Join Date: Oct 2013
Posts: 9
Default Zabbix RabbitMQ Monitoring

https://github.com/jasonmcintosh/rabbitmq-zabbix

uses the management API and user config files, plus some python scripts to monitor RabbitMQ queues and server configuration. Just thought I'd share,

Jason
Reply With Quote
  #2  
Old 13-02-2014, 22:27
mcintoshj mcintoshj is offline
Junior Member
 
Join Date: Oct 2013
Posts: 9
Default Updated

Quote:
Originally Posted by mcintoshj View Post
https://github.com/jasonmcintosh/rabbitmq-zabbix

uses the management API and user config files, plus some python scripts to monitor RabbitMQ queues and server configuration. Just thought I'd share,

Jason
I've updated this template to v2. The update uses zabbix_sender to push data back to zabbix, has some updated discovery and triggers, numerous other fixes, simplified python, etc.
Reply With Quote
  #3  
Old 14-03-2014, 14:02
Alwaysin Alwaysin is offline
Junior Member
 
Join Date: Jan 2012
Posts: 21
Default

Hi, thanks for this! It's exactly what I was loooking for

However I'm having errors in zabbix_agentd log:

Traceback (most recent call last):
File "./api.py", line 117, in <module>
main()
File "./api.py", line 106, in main
print api.check_queue(filters)
File "./api.py", line 57, in check_queue
for queueData in self.call_api('queues'):
File "./api.py", line 29, in call_api
return json.loads(urllib2.build_opener(handler).open(url) .read())
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 438, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 890, in http_error_401
url, req, headers)
File "/usr/lib/python2.7/urllib2.py", line 865, in http_error_auth_reqed
response = self.retry_http_basic_auth(host, req, realm)
File "/usr/lib/python2.7/urllib2.py", line 878, in retry_http_basic_auth
return self.parent.open(req, timeout=req.timeout)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 444, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized

What could be the reason for that?
Reply With Quote
  #4  
Old 14-03-2014, 16:55
mcintoshj mcintoshj is offline
Junior Member
 
Join Date: Oct 2013
Posts: 9
Default

Off hand, it looks like you are missing or have incorrect username/passwords. The key thing to note is the "urllib2.HTTPError: HTTP Error 401: Unauthorized" - that means that rabbitmq refused authorization using the ".rab.auth" file that should be created to use these. You should have a file: /etc/zabbix/scripts/.rab.auth
containing something like:
USERNAME=guest
PASSWORD=guest

That user has to have access to the RabbitMQ management API's.
Reply With Quote
  #5  
Old 14-03-2014, 17:42
Alwaysin Alwaysin is offline
Junior Member
 
Join Date: Jan 2012
Posts: 21
Default

Thanks for the reply!

I double-checked that I have this file and that the rights are correct. And then I wondered if I had to use capital letters like you did in your message, and it looks like this was the point...
As it is written in lowercase on the github page and on the README, maybe you should change this to prevent other ones from having this problem.

Thank you very much for your help, it is greatly appreciated!
Reply With Quote
  #6  
Old 14-03-2014, 19:30
mcintoshj mcintoshj is offline
Junior Member
 
Join Date: Oct 2013
Posts: 9
Default

Readme updated Thanks for the feedback! A thing I'm working on right now is trying to figure out which metric will give me a rate change, and then use Zabbix deltas. For example, I'm looking at the backing queue stats and the sequence ID as a possible delta field that would give me a messages per second rate. I'll post here as I update things.
Reply With Quote
  #7  
Old 27-03-2014, 17:20
Alwaysin Alwaysin is offline
Junior Member
 
Join Date: Jan 2012
Posts: 21
Default

Nice idea for an update, I'm eagerly waiting for it

Besides this, I have a suggestion : to add dependencies on triggers, so that when you've got 80% of sockets in use for example, you don't have notification for >50% and for >75% but only for >75%.

Attached is the screenshot of the dependencies I added.
Attached Images
 
Reply With Quote
  #8  
Old 27-03-2014, 17:59
mcintoshj mcintoshj is offline
Junior Member
 
Join Date: Oct 2013
Posts: 9
Default

Quote:
Originally Posted by Alwaysin View Post
Nice idea for an update, I'm eagerly waiting for it

Besides this, I have a suggestion : to add dependencies on triggers, so that when you've got 80% of sockets in use for example, you don't have notification for >50% and for >75% but only for >75%.

Attached is the screenshot of the dependencies I added.
Will get the template updated hopefully here a bit later today with the dependencies Thanks for the suggestion! I don't have a good feel right now on the delta for message rates - so that's still a "goal" rather than something I'm super actively working on. But I can at least get your dependencies added! Note, I've updated the template recently and the API python has gone through some significate revisions allowing filtering and more advanced configuration.
Reply With Quote
  #9  
Old 27-03-2014, 18:02
mcintoshj mcintoshj is offline
Junior Member
 
Join Date: Oct 2013
Posts: 9
Default

Quote:
Originally Posted by mcintoshj View Post
Will get the template updated hopefully here a bit later today with the dependencies Thanks for the suggestion! I don't have a good feel right now on the delta for message rates - so that's still a "goal" rather than something I'm super actively working on. But I can at least get your dependencies added! Note, I've updated the template recently and the API python has gone through some significate revisions allowing filtering and more advanced configuration.
SO here's a fun question on this. Is it better to do dependencies, or to add a "And less than 75%" as part of the check. I'm not sure which are more efficient - depenedencies or the extra check on the trigger. I've done both ways.
Reply With Quote
  #10  
Old 24-07-2014, 17:40
rchannel rchannel is offline
Junior Member
 
Join Date: Apr 2014
Posts: 5
Default URL issues.

Found this issue, I do not know how to delete this post. I missed a where the password variable was set.

I keep getting errors in the url and authentication. I have moved my user and password into the api to eliminate the conf file as a issue.

Traceback (most recent call last):
File "api.py", line 184, in <module>
main()
File "api.py", line 169, in main
print json.dumps({'data': api.list_nodes()})
File "api.py", line 56, in list_nodes
for node in self.call_api('nodes'):
File "api.py", line 32, in call_api
return json.loads(urllib2.build_opener(handler).open(url) .read())
File "/usr/lib64/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.6/urllib2.py", line 429, in error
result = self._call_chain(*args)
File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib64/python2.6/urllib2.py", line 880, in http_error_401
url, req, headers)
File "/usr/lib64/python2.6/urllib2.py", line 858, in http_error_auth_reqed
return self.retry_http_basic_auth(host, req, realm)
File "/usr/lib64/python2.6/urllib2.py", line 868, in retry_http_basic_auth
return self.parent.open(req, timeout=req.timeout)
File "/usr/lib64/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.6/urllib2.py", line 435, in error
return self._call_chain(*args)
File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib64/python2.6/urllib2.py", line 518, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized

Last edited by rchannel; 18-08-2014 at 17:32. Reason: Solved this issue.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:01.