mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Graphical statistics
* Support for hostnames containing '-' characters * Documentation update fixes #261
This commit is contained in:
@@ -1144,14 +1144,13 @@ First, adapt the following parameters to your environnement::
|
||||
RRD_ROOTDIR = "/tmp/modoboa"
|
||||
|
||||
# Path to directory where png files are stored
|
||||
IMG_ROOTDIR = "<modoboa_dir>/static/graphs"
|
||||
IMG_ROOTDIR = "<modoboa_dir>/media/stats"
|
||||
|
||||
Make sure the directories that will contain those files exist. If not,
|
||||
create them before going further. For example (according to the previous
|
||||
Make sure the directory that will contain those files exist. If not,
|
||||
create it before going further. For example (according to the previous
|
||||
parameters)::
|
||||
|
||||
$ mkdir /tmp/modoboa
|
||||
$ mkdir <modoboa_dir>/static/graphs
|
||||
|
||||
To finish, you need to collect information periodically in order to
|
||||
feed the rrd files. To do so, just add the following line into root's
|
||||
|
||||
@@ -66,7 +66,7 @@ class LogParser(object):
|
||||
|
||||
self.workdict = {}
|
||||
self.lupdates = {}
|
||||
self.line_expr = re.compile("(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\w+)\s+(\w+)/?\w*[[](\d+)[]]:\s+(.*)")
|
||||
self.line_expr = re.compile("(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+([-\w]+)\s+(\w+)/?\w*[[](\d+)[]]:\s+(.*)")
|
||||
|
||||
def init_rrd(self, fname, m):
|
||||
"""init_rrd
|
||||
|
||||
@@ -23,10 +23,12 @@ urlpatterns = patterns('',
|
||||
)
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += patterns(
|
||||
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
|
||||
{'document_root': settings.MEDIA_ROOT, 'show_indexes' : True}),
|
||||
url(r'', include('django.contrib.staticfiles.urls')),
|
||||
)
|
||||
|
||||
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
from django.conf.urls.static import static
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
# urlpatterns += patterns(
|
||||
# url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
|
||||
# {'document_root': settings.MEDIA_ROOT, 'show_indexes' : True}),
|
||||
# url(r'', include('django.contrib.staticfiles.urls')),
|
||||
# )
|
||||
|
||||
Reference in New Issue
Block a user