moved scripts that need uploading to zope to separate dir
authorArthur Lutz <arthur.lutz@logilab.fr>
Tue, 01 Jul 2008 12:38:11 +0200
changeset 10 3c0f45cec8e3
parent 9 2b3a5abc218c
child 11 36df17803ebf
moved scripts that need uploading to zope to separate dir
munin_error_stats.py
zope_python_scripts/munin_error_stats.py
--- a/munin_error_stats.py	Tue Jul 01 12:33:52 2008 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-## Script (Python) "munin_error_stats.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_error_stats".
-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 = {'chart_start':then,
-               'chart_end':now}
-
-error_log = context.restrictedTraverse('error_log')
-entries = []
-types = []
-users = []
-for entry in error_log.getLogEntries():
-    if entry['time'] <= float(DateTime()-1):
-        pass
-    entries.append(entry)
-    if entry['type'] not in types:
-        types.append(entry['type'])
-    if entry['userid'] not in users:
-        users.append(entry['userid'])
-
-print len(entries), len(types), len(users)
-
-return printed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zope_python_scripts/munin_error_stats.py	Tue Jul 01 12:38:11 2008 +0200
@@ -0,0 +1,44 @@
+## Script (Python) "munin_error_stats.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_error_stats".
+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 = {'chart_start':then,
+               'chart_end':now}
+
+error_log = context.restrictedTraverse('error_log')
+entries = []
+types = []
+users = []
+for entry in error_log.getLogEntries():
+    if entry['time'] <= float(DateTime()-1):
+        pass
+    entries.append(entry)
+    if entry['type'] not in types:
+        types.append(entry['type'])
+    if entry['userid'] not in users:
+        users.append(entry['userid'])
+
+print len(entries), len(types), len(users)
+
+return printed