Graph all the things

RRDtool is a great way of storing metric data, however the charts it produces look dated now, especially considering how good modern JS based visualization libraries such as D3 have become. I wanted to understand RRDtool better, so this gave me an opportunity to write a front end for RRDTool that uses NVD3 to display RRD data as charts.

The Live Example uses data from the Mosquitto MQTT Server as a source.
Example

Installation

RRDViewer is hosted on Git Hub, you can download the zip file, or you can clone/fork your own copy of the repository.

First setup a Django project, Once you have the code, install using the supplied setup.py. If you are using git, be sure to use the –recursive flag, or otherwise ensure all sub modules are downloaded before running setup.

$ sudo python setup.py install

Then add ‘rrdviewer’ to your INSTALLED_APPS list in settings.py:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    ....
    'rrdviewer',
    ....
)

Then setup your GRAPH_DIR in settings.py to point to a directory containing a bunch of RRD files. RRDViewer will recursively search that directory for RRD files to include.

GRAPH_PATH='/var/lib/rrd_data'

Once the application is installed, run collectstatic to copy the static files to their correct location:

$ sudo python manage.py collectstatic

Finally, setup your urls.py to include the urls for rrdviewer at your preferred location:

urlpatterns = patterns('',
    url(r'^rrdviewer/', include('rrdviewer.urls')),
)

You can now restart the web browser and visit the RRDViewer page.

One thought on “Visualizing RRD data using NVD3

  1. What could be the reason for:
    Exception Type: ViewDoesNotExist at /rrdviewer/
    Exception Value: Could not import rrdviewer.views.list_graphs. View does not exist in module rrdviewer.views.

    Reply

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required