[rrd-users] python rrdtool error -?

Gregory Guthrie guthrie at mum.edu
Fri Apr 2 23:07:14 CEST 2010


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

Error:
       "--end   ", str(end)  )
       rrdtool.error: unknown option '-

Adding an additional (superfluous?) space before the - options gets rid of the errors, but gives no results.
      " -start",      etc.
-------------------------------------------
Dr. Gregory Guthrie

Computer Science Department
School of Computer Science & Mathematics
Maharishi University of Management
------------------------------------------- 




More information about the rrd-users mailing list