[rrd-users] Use RRDTool On Windows With Python - Cant import rrdtool
Mark Easton
mark.easton at azurebell.co.nz
Mon Feb 5 19:05:46 CET 2007
With the help of Alex van den Bogaerdt I now know that the problem lies with
Python25. The extension breaks under 2.5. Once I changed to Python 2.4 it
worked fine.
Mark Easton wrote:
>
> So, I have looked at the ctypes function. Why was that not covered off in
> the instructions as posted by Miro when he created the dlls. Surely his
> code does not work or am I missing something?? So, now I have :
>
> rom ctypes import *
> rrdtool = cdll.LoadLibrary("rrdtool.dll")
> import os
> import time
> import random
> import math
>
> if os.path.exists('test.rrd'):
> os.remove('test.rrd')
>
> start = int( time.mktime( (2006,1,1,0,0,0,0,0,-1) ) )
> end = int( time.mktime( (2006,1,3,0,0,0,0,0,-1) ) )
>
> print 'rrdtool Python test'
> print 'time start: ',start, ' end: ',end
>
> print 'creating rrd database ...'
> rrdtool.create( 'test.rrd', \
> '--start', str(start), \
> 'DS:speed:GAUGE:60:U:U', \
> 'RRA:AVERAGE:0.5:1:%s' % (24 * 60), \
> 'RRA:AVERAGE:0.5:10:%s' % (32 * 24 * 6), \
> 'RRA:MAX:0.5:1:%s' % (24 * 60), \
> 'RRA:MAX:0.5:10:%s' % (32 * 24 * 6) )
>
> ...
>
>
>
> But I get this response:
>
> rrdtool Python test
> time start: 1136026800 end: 1136199600
> creating rrd database ...
> Traceback (most recent call last):
> File "E:\work\komodo\gopher\test_rrd.py", line 19, in <module>
> rrdtool.create( 'test.rrd', \
> File "C:\Python25\lib\ctypes\__init__.py", line 325, in __getattr__
> func = self.__getitem__(name)
> File "C:\Python25\lib\ctypes\__init__.py", line 330, in __getitem__
> func = self._FuncPtr((name_or_ordinal, self))
> AttributeError: function 'create' not found
>
>
> So, it does not find the rrdtool funrtion "create". What must I do now?
>
--
View this message in context: http://www.nabble.com/Use-RRDTool-On-Windows-With-Python---Cant-import-rrdtool-tf3172333.html#a8811523
Sent from the RRDTool - User mailing list archive at Nabble.com.
More information about the rrd-users
mailing list