[rrd-users] Python-RRDtool

Marius Rugan mariusrugan at gmail.com
Fri Jun 6 19:34:12 CEST 2008


Hi Emily,

you should reply to the list :)
a lot of nice people subscribed to it and it's a good chance somebody would
help you out.

take a look at this class,
http://www.goldb.org/rrdpython.html
it implements calling rrdtool as shell executable.

i would suggest that you strip everything unnecessary like creating a rrd
*(which you can do using the binary rrdtool <create>, and following one
example @ rrdtool website - data transferred on a network interface or any
example that suits you)
*and focus on understanding the update process.

further on you can try installing any of the following rrdtool modules
available to python:

http://www.nongnu.org/py-rrdtool/
http://code.google.com/p/rrdpy/ (it's the same author for the class in the
first link, goldb.org)
http://coreygoldberg.blogspot.com/2008/05/python-rrdpy-round-robin-databases.html

Have fun.

On Fri, Jun 6, 2008 at 5:13 PM, Emily Chouinard <cousin17 at msu.edu> wrote:

> Yeah it just seems that the downloads.rrd was missing, I though the example
> on the website was a real one you could try and do yourself but now I
> realize it wasn't, silly me. I am still looking for an example of
> python-rrdtool. I would like it if someone would let me see a piece of
> python code where they used rrdtool, because as I said before I am a
> beginner and I'm trying to get this all figured out but I learn better
> through example. Thanks for all your help!!!
>
> Marius Rugan wrote:
>
>> Hi Emily,
>>
>> Please let us know what you are trying to achieve and how your code
>> snippet looks like.
>>
>> On the error:
>> obviously, the script cannot find the rrd database file.
>> I would suggest that you play around with rrdtool in its binary form, e.g.
>> rrdtool create, rrdtool update, rrdtool graph
>> and than start porting the command line switches to the python script.
>> Copy paste code doesn't actually work unless you understand every switch's
>> meaning ( for example '--imgformat', 'PNG' )
>> and replace variables accordingly to your environment (path for example)
>>
>>
>> On Thu, Jun 5, 2008 at 10:53 PM, Emily Chouinard <cousin17 at msu.edu<mailto:
>> cousin17 at msu.edu>> wrote:
>>
>>    I am a newbie and I am having difficulty running the example on
>>    python-
>>    rrdtool. I have followed it word for word off the website
>>    >>> rrdtool.graph(path,
>>            '--imgformat', 'PNG',
>>            '--width', '540',
>>            '--height', '100',
>>            '--start', "-%i" % YEAR,
>>            '--end', "-1",
>>            '--vertical-label','Downloads/Day',
>>            '--title', 'Annual Downloads',
>>            '--lower-limit', '0',
>>    DEF:downloads=downloads.rrd:downloads:AVERAGE',
>>    'AREA:downloads#990033:Downloads')
>>
>>    and getting getting this error
>>
>>    Traceback (most recent call last): File "<stdin>", line 1, in ?
>>    rrdtool.error: opening 'downloads.rrd': No such file or directory
>>
>>    I'm just lost and confused and really need a step by step. I'm a very
>>    green programmer so if anyone can guide me towards tutorials and what
>>    not I would really appreciate it because I need more information that
>>    what I can find on the RRDtool website but I haven't been able to find
>>    any.
>>
>>    Thanks, Emily
>>
>>
>>    _______________________________________________
>>    rrd-users mailing list
>>    rrd-users at lists.oetiker.ch <mailto:rrd-users at lists.oetiker.ch>
>>    https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> rrd-users mailing list
>> rrd-users at lists.oetiker.ch
>> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>>
>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20080606/8d0d8ed6/attachment.html 


More information about the rrd-users mailing list