X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=doc%2Frrdpython.pod;h=d504deb47bef903264abaf269abc24d18463fa1a;hb=4d750c3e02acd806f8db83b4737afac2110cfa0f;hp=a158577f7f983dd474e3bf3b569a03fc3ce4eeb9;hpb=9b1205b30b37e1ef53666a1a1d51b573259becdf;p=rrdtool.git diff --git a/doc/rrdpython.pod b/doc/rrdpython.pod index a158577..d504deb 100644 --- a/doc/rrdpython.pod +++ b/doc/rrdpython.pod @@ -18,13 +18,15 @@ to the other B documentation for functions and valid arguments. =head1 EXAMPLE + import sys + sys.path.append('/path/to/rrdtool/lib/python2.3/site-packages/') import rrdtool, tempfile DAY = 86400 YEAR = 365 * DAY fd,path = tempfile.mkstemp('.png') - rrdtool.graph(path, + rrdtool.graph(path, '--imgformat', 'PNG', '--width', '540', '--height', '100', @@ -40,6 +42,11 @@ to the other B documentation for functions and valid arguments. print info['last_update'] print info['ds']['downloads']['minimal_heartbeat'] +If you use the B make target you can drop to first sys.path.append +line since the rrdtool module will be available everywhere. + +If rrdtool runs into trouble, it will throw an exception which you might want to catch. + =head1 SEE ALSO rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast,