This is not a library. This is just a module which contains set of example rrd graphs generators for some standard collectd plugins.
Additionally it contains my pyrrd backend which handles localization - labels on graphs are translated (I'm talking here about legends generated by RRD (for example weekdays)). Of course you can provide translation of all labels but it has to be done in Python code (replace fake ugettext
calls from graphs.py
with real one).
My pyrrd backend is based on pyrrd.backends.external
but I'm going to provide additional one which will extend pyrrd.backend.bindings
.
As it is not an real python library setup.py
is missing. If you want to try my generators you should clone this repo and install dependencies (probably in virtualenv):
$ pip install -r REQUIREMENTS
You can generate graphs with provided module:
$ python graphs.py --help
As I mentioned above this is (intentionally) not really extensible piece of code. This is also (intentionally) not very DRY written piece of code. If you want refactorize/customize anything you should copy desired sections straight into your project and modify them.
Let's assume that my rrd bases are in ./rrd/host1
directory:
$ python graphs.py cpu --rrd-dir=./rrd/host1/cpu-0 --locale='pl_PL' --end='2013-03-28' -o cpu.png
$ python graphs.py load --rrd-dir=./rrd/host1/load --locale='pl_PL' --end='2013-03-28' -o load.png
$ python graphs.py interface --rrd-dir=./rrd/host1/inteface-eth0 --locale='pl_PL' --end='2013-03-28' -o interface.png
$ python graphs.py memory --rrd-dir=./rrd/host1/memory --locale='pl_PL' --end='2013-03-28' -o memory.png
$ python graphs.py disk --rrd-dir=./rrd/host1/disk-xvda2 --locale='pl_PL' --end='2013-03-28' --logarithmic -o disk.png && gqview disk.png