[rrd-users] python rrdtool error -?

Tobias Oetiker tobi at oetiker.ch
Sat Apr 3 00:53:42 CEST 2010


Hi Gregory,

try

Yesterday Gregory Guthrie wrote:

> The following python program fails, but the equivalent command line usage works fine, and in fact invoking the command line from the program also works.
>
> I can't see what is wrong with the python API usage of fetch() below.
>
>    start = int( time.mktime( (2010,3,1,  0,0,0,  0,0, -1) ) )
>    end   = int( time.mktime( (2010,4,10, 0,0,0,  0,0, -1) ) )
>    print "Dump from:", start, end
>    os.system('rrdtool fetch ' + data("temp") +             \
>                 " AVERAGE" + " --start " + str(start)   \
>                            + " --end  "  + str(end)     )		# works
>    rrdtool.fetch( data("temp"),
>                 "AVERAGE", "--start ", str(start),
>                            "--end   ", str(end)  )		# fails - error below
   rrdtool.fetch( data("temp"),
                "AVERAGE", "--start", str(start),
                           "--end", str(end)  )		# fails - error below


note the options have NO spaces at the end ...

cheers
tobi


-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900


More information about the rrd-users mailing list