3 rrdpython - About the RRD Python bindings
8 rrdtool.create('/tmp/test.rrd', 'DS:foo:GUAGE:20:0:U')
12 The B<rrdtool> functions are directly callable via the Python programming
13 language. This wrapper implementation has been written from the scratch
16 The API's simply expects string parameters to the functions. Please refer
17 to the other B<rrdtool> documentation for functions and valid arguments.
22 sys.path.append('/path/to/rrdtool/lib/python2.3/site-packages/')
23 import rrdtool, tempfile
27 fd,path = tempfile.mkstemp('.png')
33 '--start', "-%i" % YEAR,
35 '--vertical-label', 'Downloads/Day',
36 '--title', 'Annual downloads',
38 'DEF:downloads=downloads.rrd:downloads:AVERAGE',
39 'AREA:downloads#990033:Downloads')
41 info = rrdtool.info('downloads.rrd')
42 print info['last_update']
43 print info['ds']['downloads']['minimal_heartbeat']
45 If you use the B<site-python-install> make target you can drop to first sys.path.append
46 line since the rrdtool module will be available everywhere.
48 If rrdtool runs into trouble, it will throw an exception which you might want to catch.
52 rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast,
57 Hye-Shik Chang E<lt>perky@i18n.orgE<gt>
59 Alan Milligan E<lt>alan.milligan@last-bastion.netE<gt>