collective / munin.zope

Munin plugins for Zope/Plone.
http://pypi.python.org/pypi/munin.zope
0 stars 1 forks source link

support zodb and blobstorage size too #2

Open frisi opened 11 years ago

frisi commented 11 years ago

to collect data for db and blobstorage size we need a way to address different storages via the munin symlinks. mauro already added a filestorage parameter in https://github.com/collective/munin.zope/commit/4db6fc46f55e4d0beeeb8dd4fb4a5c7d0977bc1e but he's adressing the url directly (eg http://localhost:8080/@@munin.zope.plugins/zopecache?filestorage=anotherstorage) and is not using the bin/munin1 scripts.

currently there is support for a prefix and suffix. the prefix is unused and the suffix is used to make up the graph title and distinguish different projects. (see issue #1)

with the current version of gocept.munin and munin zope we could think about adding this parameter to the suffix by creating the following symlinks manually::

project1_dbsize_project1-main
project1_dbsize_project1   #checks main database too
project1_dbsize_project1-anotherstorage

the graph will be in category Zope titled Size of Database project1-main and munin.zope.plugins.run could extract the database name from the argv suffix (if a - is present, otherwhise use main) and append the parameter to environ['URL']

currently there is no (and probably never will be a) way to get the blobstorage size via the ZODB/Zope-API (see https://github.com/zopefoundation/ZODB/issues/8) i already did a proof of concept implementation (https://github.com/webmeisterei/munin.zope/commit/ba1b4d6d046e69ad49e4d633f0b23181c7ceec85) but wanted to discuss how to enable this feature in munin.zope first before working on the pull request.

the cleanest way from my point of view would be to implement solution B in #1. The prefix would be used to identify the project and the suffix to identify the instance or filestorage (depending on the graph/plugin):

project1_zopememory_instance1 -> /buildouts/project1/bin/munin1
project1_zopememory_instance2 -> /buildouts/project1/bin/munin2
project1_dbsize_main -> /buildouts/project1/bin/munin1
project1_blobsize_anotherstorage -> /buildouts/project1/bin/munin1

(we need to adapt the install method, so bin/munin1 install will produce working symlinks for dbsize and blobsize)

mamico commented 11 years ago

I've added code for manage mutilple storage here 4a6dbf3, awesome if you can check if works like you needed.

About blobdir disk usage, I think that use a zope for disk usage calculation can be too expensive (also if you cache results), my suggestion is to use other munin plugin, like http://munin-monitoring.org/browser/munin-contrib/plugins/disk/du-2, http://munin-monitoring.org/browser/munin-contrib/plugins/disk/du, http://aouyar.github.io/PyMunin/plugins/diskusage.html.