Graphical statistics

* Support for hostnames containing '-' characters
* Documentation update

fixes #261
This commit is contained in:
Antoine Nguyen
2012-06-09 11:04:20 +02:00
parent 85d83400f3
commit 0c6dc13168
3 changed files with 13 additions and 12 deletions
+3 -4
View File
@@ -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
+1 -1
View File
@@ -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
+9 -7
View File
@@ -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')),
# )