mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Category Tree: Reduce number of categories
zope -> appserver
This commit is contained in:
parent
f523f095f9
commit
68bb709de6
6 changed files with 3 additions and 3 deletions
27
plugins/zope/scripts_zodb/munin_cache_parameters.py
Normal file
27
plugins/zope/scripts_zodb/munin_cache_parameters.py
Normal 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
|
34
plugins/zope/scripts_zodb/munin_db_activity.py
Normal file
34
plugins/zope/scripts_zodb/munin_db_activity.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue