zenoss / zenpacks.zenoss.rabbitmq Goto Github PK
View Code? Open in Web Editor NEWRabbitMQ Monitoring for Zenoss
License: GNU General Public License v2.0
RabbitMQ Monitoring for Zenoss
License: GNU General Public License v2.0
2016-05-19 13:56:08,171 ERROR zen.ZenModeler: : Traceback (most recent call last):
File "/opt/zenoss/Products/ZenHub/PBDaemon.py", line 101, in inner
return callable(_args, *_kw)
File "/opt/zenoss/Products/ZenHub/services/ModelerService.py", line 163, in remote_applyDataMaps
if adm._applyDataMap(device, map, commit=False):
File "/opt/zenoss/Products/DataCollector/ApplyDataMap.py", line 126, in _applyDataMap
return self._applyDataMapImpl(device, datamap)
File "/opt/zenoss/Products/DataCollector/ApplyDataMap.py", line 176, in _applyDataMapImpl
tobj = device.getObjByPath(datamap.compname)
File "/opt/zenoss/Products/ZenModel/ZenModelBase.py", line 641, in getObjByPath
return getObjByPath(self, path)
File "/opt/zenoss/Products/ZenUtils/Utils.py", line 302, in getObjByPath
next=obj[name]
File "/opt/zenoss/lib/python2.7/site-packages/OFS/ObjectManager.py", line 777, in getitem
raise KeyError, key
KeyError: 'rabbitmq_nodes'
Traceback (most recent call last):
File "/opt/zenoss/Products/DataCollector/zenmodeler.py", line 684, in processClient
if driver.next():
File "/opt/zenoss/Products/ZenUtils/Driver.py", line 63, in result
raise ex
RemoteException: : Traceback (most recent call last):
File "/opt/zenoss/Products/ZenHub/PBDaemon.py", line 101, in inner
return callable(_args, *_kw)
File "/opt/zenoss/Products/ZenHub/services/ModelerService.py", line 163, in remote_applyDataMaps
if adm._applyDataMap(device, map, commit=False):
File "/opt/zenoss/Products/DataCollector/ApplyDataMap.py", line 126, in _applyDataMap
return self._applyDataMapImpl(device, datamap)
File "/opt/zenoss/Products/DataCollector/ApplyDataMap.py", line 176, in _applyDataMapImpl
tobj = device.getObjByPath(datamap.compname)
File "/opt/zenoss/Products/ZenModel/ZenModelBase.py", line 641, in getObjByPath
return getObjByPath(self, path)
File "/opt/zenoss/Products/ZenUtils/Utils.py", line 302, in getObjByPath
next=obj[name]
File "/opt/zenoss/lib/python2.7/site-packages/OFS/ObjectManager.py", line 777, in getitem
raise KeyError, key
KeyError: 'rabbitmq_nodes'
2016-05-19 13:56:08,172 ERROR zen.ZenModeler: Client vg0dmq01 finished with message: [Failure instance: Traceback (failure with no frames): <class 'Products.ZenHub.PBDaemon.RemoteException'>: : Traceback (most recent call last):
File "/opt/zenoss/Products/ZenHub/PBDaemon.py", line 101, in inner
return callable(_args, *_kw)
File "/opt/zenoss/Products/ZenHub/services/ModelerService.py", line 163, in remote_applyDataMaps
if adm._applyDataMap(device, map, commit=False):
File "/opt/zenoss/Products/DataCollector/ApplyDataMap.py", line 126, in _applyDataMap
return self._applyDataMapImpl(device, datamap)
File "/opt/zenoss/Products/DataCollector/ApplyDataMap.py", line 176, in _applyDataMapImpl
tobj = device.getObjByPath(datamap.compname)
File "/opt/zenoss/Products/ZenModel/ZenModelBase.py", line 641, in getObjByPath
return getObjByPath(self, path)
File "/opt/zenoss/Products/ZenUtils/Utils.py", line 302, in getObjByPath
next=obj[name]
File "/opt/zenoss/lib/python2.7/site-packages/OFS/ObjectManager.py", line 777, in getitem
raise KeyError, key
KeyError: 'rabbitmq_nodes'
]
Is there a reason to use the rabbitmq commands rather than the HTTP API?
It is my understanding that all of the data available via the command line API is also available of the HTTP API. Are there any plans to support both?
What about a merge request with support for the HTTP API?
i've got this error on the few RMQ servers and have no idea how to fix it.
ERROR zen.ZenModeler: Traceback (most recent call last):
File "/opt/zenoss/Products/DataCollector/zenmodeler.py", line 647, in processClient
datamaps = plugin.process(device, results, self.log)
File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.RabbitMQ-1.0.7.egg/ZenPacks/zenoss/RabbitMQ/modeler/plugins/zenoss/ssh/RabbitMQ.py", line 88, in process
device, command_strings[1], 'rabbitmq_nodes/%s' % node_id))
File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.RabbitMQ-1.0.7.egg/ZenPacks/zenoss/RabbitMQ/modeler/plugins/zenoss/ssh/RabbitMQ.py", line 117, in getVHostRelMap
'%s/rabbitmq_vhosts/%s' % (compname, vhost_id))
File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.RabbitMQ-1.0.7.egg/ZenPacks/zenoss/RabbitMQ/modeler/plugins/zenoss/ssh/RabbitMQ.py", line 177, in getQueueRelMap
re.split(r'\s+', queue_string)
ValueError: too many values to unpack
I get the following error whenever I try to access any of the RabbitMQ "Components" from a device (ex: "RabbitMQ Nodes").
ValueError No 'where' clause found for event_key ComponentId
Applying the following patch stopped the error from appearing, but I don't really understand the ramifications of the change:
diff --git a/ZenPacks/zenoss/RabbitMQ/RabbitMQComponent.py b/ZenPacks/zenoss/RabbitMQ/RabbitMQComponent.py
index e588399..f56aed7 100644
--- a/ZenPacks/zenoss/RabbitMQ/RabbitMQComponent.py
+++ b/ZenPacks/zenoss/RabbitMQ/RabbitMQComponent.py
@@ -36,8 +36,5 @@ class RabbitMQComponent(DeviceComponent, ManagedEntity):
},),
},)
- # Query for events by id instead of name.
- event_key = "ComponentId"
-
# Commands are run via SSH and should not be specified absolutely.
zCommandPath = ''
Software Component Versions
Zenoss Zenoss 3.2.0
Zope Zope 2.12.1
Python Python 2.6.2
Database MySQL 5.0.77 (Ver 5.0.77)
RRD RRDtool 1.3.9
Twisted Twisted 8.1.0
NetSnmp NetSnmp 5.3.2
PyNetSnmp PyNetSnmp 0.29.13
WMI Wmi 1.3.13
In RabbitMQQueue.py rabbitmq_vhost
relationship remote class should be ZenPacks.zenoss.RabbitMQ.RabbitMQVHost.RabbitMQVHost
not ZenPacks.zenoss.RabbitMQ.RabbitMQNode.RabbitMQVHost
.
In RabbitMQExchange.py, rabbitmq_vhost
relationship remote class should be ZenPacks.zenoss.RabbitMQ.RabbitMQVHost.RabbitMQVHost
not ZenPacks.zenoss.RabbitMQ.RabbitMQNode.RabbitMQVHost
.
The throughput graph is using the 'recvCount' and 'sentCount' metrics, which are derived from the 'recv_cnt' and 'send_cnt' Connection metrics. Per the rabbitmqctl manpage, both of those metrics track the number of packets sent and received, not messages.
After installing this Zenpack and adding the modeler plugin to our Rabbit node, now every single server we have has the following template bound: /devices/RabbitMQNode
If you do an uninstall on the ZenPack it leaves components on the device. If you click on a component a ribbon error is displayed. The template also remains on the system.
I have been using the RabbitMQ zenpack for about a week, and several RRDs only have NaN values (recvBytes, recvCount, et al.).
After some digging, I found that the variable "results.values" in the file parsers/RabbitMQCTL.py had repeated some fields and was missing others, e.g. (note sendCount)
[(({}, 'connections'), 2), (({}, 'channels'), 2), (({}, 'sendQueue'), 0), (({}, 'sendCount'), 14), (({}, 'sendCount'), 14), (({}, 'sendCount'), 14), (({}, 'sendCount'), 14)]
line 162 in parsers/RabbitMQCTL.py reads:
for field in delta_metrics:
changing it to this:
for metric in delta_metrics:
seemed to fix the problem.
This looks like a simple typo, the loop declaration uses a "field" variable which is never referenced in the loop body, the loop body in fact uses the "metric" variable which was last used in a previous loop.
After the change, the RRDs and graphs have real values, and the results.values variable looks correct.
Let me know what you think.
I'm running the zenpack with RabbitMQ 2.2.0 on RHEL5. Rabbitmqctl command is run as a rabbitmq user on the server. Zenpack provides data to the device graphs correctly but doesn't populate the components. When running command manually on the RabbitMQ server data comes out just fine.
When running zenmodeler manually I see in the logs:
2012-02-08 11:53:32,416 DEBUG zen.SshClient: x.x.x.x channel 1 CommandChannel exit code for rabbitmqctl status 2>&1 && (echo COMMAND ; for vhost in $(rabbitmqctl -q list_vhosts) ; do echo "VHOST: $vhost" ; echo "SPLIT" ; rabbitmqctl -q list_exchanges -p $vhost name type durable auto_delete arguments ; echo "SPLIT" ; rabbitmqctl -q list_queues -p $vhost name durable auto_delete arguments ; echo "VHOST" ; done) is 127: Command not found
I guess it can't find the rabbitmqctl command. It is located in /usr/sbin and I've set that path to zCommandPath. I don't wish to access the RabbitMQ server as a root. How can I get the path right?
Now that Core 4 is using RabbitMQ, it would seem logical that the RabbitMQ pack could be used to monitor the Rabbit instance running on your Zenoss Core master server, however this pack seems demand modeling and collection over SSH. Would it be possible to update this so you run it against localhost as well? In case it helps, here is the output when running the modeler showing the SSH connection attempt to localhost:
2012-03-15 11:17:05,964 INFO zen.ZenModeler: plugins: zenoss.ssh.RabbitMQ
2012-03-15 11:17:05,965 DEBUG zen.SshClient: 127.0.0.1 SshClient connecting to localhost:22 with timeout 10.0 seconds
I think that a more sane way to pull information from RabbitMQ is through the web management plugin. It is super easy to install and provides all the necessary information and is also more light-weight. There is already a Python CLI tool to pull the information and it should not be too difficult to adapt it to Zenoss. Further information: http://www.rabbitmq.com/management-cli.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.