[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [py-rrdtool-users] RE: py-rrdtool usage (Markus Törnqvist)
From: |
Markus Törnqvist |
Subject: |
Re: [py-rrdtool-users] RE: py-rrdtool usage (Markus Törnqvist) |
Date: |
Sat, 15 Mar 2003 13:20:28 +0200 |
User-agent: |
Mutt/1.4i |
On Fri, Mar 14, 2003 at 02:23:47PM -0500, Reuben Stump wrote:
>Markus,
>
>It wasn't so bad to make use of, it's much like Perl's bindings. I've
>converted my old CGI from Perl to Python and have had 0 issues so far,
>though to be honest, I haven't been using more than RRD::Graph at this
>point.
Yes, well, I have practically no experience in Perl :)
>I thought I might pass on what I found in the past, it might get you
>started.
Thank you!
>Each option passed to the RRD commands must be placed a seperate parameter
>to RRD functions. So you can't just create one long string and send it into
>the function.
Aaah, this is probably where I messed it up...
>import rrdtool
>
>try:
> aDictionary = rrdtool.info('/var/rrd/AnRRD.log')
>except rrdtool.error, err:
> print "RRD error:", err
>
>
>Same for Graphing:
>
>try:
> size = rrdtool.graph('demo.gif','--title="Demo Graph"',
> 'DEF:cel=demo.rrd:exhaust:AVERAGE',
>'CDEF:far=cel,1.8,*,32,+',
> 'LINE2:cel#00a000:"D. Celsius"', 'LINE2:far#ff0000:"D.
>Fahrenheit"')
>except rrdtool.error, err:
> print "RRD Error:", err
>
So it essentially works like calling the shell rrdtool..?
Ok, Thanks!
I did some basic testing with os.system() but I think I'll rewrite those
parts :)
But considering how great a language Python is and how great RRDTool
is with graphing, I still believe that python-rrdtool deserves clearer
documentation and then publicity :)
--
Markus Törnqvist