1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-09-19 00:53:19 +00:00

Extract tarballs committed to git as plugins.

This commit is contained in:
Diego Elio Pettenò 2012-08-06 22:16:31 -07:00
parent 2dad4c6f70
commit 038c3ce96b
15 changed files with 352 additions and 0 deletions

View file

@ -0,0 +1,27 @@
## Script (Python) "munin_cache_parameters.py"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
"""
Fetches data about the ZODB for the munin plugin "zope_cache_parameters".
Needs the Manager proxy role to work.
Only answers requests from localhost directly to zopes port.
"""
req = context.REQUEST
if req['HTTP_X_FORWARDED_FOR'] or req['REMOTE_ADDR'] != '127.0.0.1':
return "This script can only be called frm localhost"
maindb = context.restrictedTraverse('/Control_Panel/Database/main')
print maindb.database_size(), # Total number of objects in the database
print maindb.cache_length(), # Total number of objects in memory from all caches
print len(maindb.cache_detail_length()) * maindb.cache_size() # Target number of objects in memory sum total
return printed

View file

@ -0,0 +1,34 @@
## Script (Python) "munin_db_activity.py"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
"""
Fetches data about the ZODB for the munin plugin "zope_db_activity".
Needs the Manager proxy role to work.
Only answers requests from localhost directly to zopes port.
"""
req = context.REQUEST
if req['HTTP_X_FORWARDED_FOR'] or req['REMOTE_ADDR'] != '127.0.0.1':
return "This script can only be called frm localhost"
sec = 60*5 # 5 min is munins update frequency
now = float(DateTime())
then = now-sec
request = dict(chart_start=then,
chart_end=now)
maindb = context.restrictedTraverse('/Control_Panel/Database/main')
cd = maindb.getActivityChartData(200, request)
print cd['total_load_count'],cd['total_store_count'],cd['total_connections']
return printed