|
From: | Reuben Stump |
Subject: | RE: [py-rrdtool-users] RE: py-rrdtool usage (Markus Törnqvist) |
Date: | Mon, 17 Mar 2003 10:02:58 -0500 |
I think it most definitely needs a little documentation. It's pretty simple I think to get started once you see how it's done. =)
But yes, as for calling functions in RRDTool, you can just use the documentation on the RRDTool homepage. From the script side, it's almost like a wrapper around the RRDTool commands, with the catch of formatting each RRDTool command option as a seperate function argument.
The errors are also the same generated by RRDTool.
But I also have to agree, I much prefer using Python with my RRDTool problems.
Let me know if I can help more.
> Reuben M. Stump
-----Original Message-----
From: Markus Törnqvist [mailto:address@hidden]
Sent: Saturday, March 15, 2003 6:20 AM
To: Reuben Stump
Cc: 'address@hidden'
Subject: Re: [py-rrdtool-users] RE: py-rrdtool usage (Markus Törnqvist)
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
[Prev in Thread] | Current Thread | [Next in Thread] |