Reputation: 353
from pyrrd.rrd import DataSource, RRA, RRD
filename = 'test.rrd'
dataSources = []
roundRobinArchives = []
dataSource = DataSource(dsName='speed', dsType='COUNTER', heartbeat=600)
dataSources.append(dataSource)
roundRobinArchives.append(RRA(cf='AVERAGE', xff=0.5, steps=1, rows=24))
roundRobinArchives.append(RRA(cf='AVERAGE', xff=0.5, steps=6, rows=10))
myRRD = RRD(filename, ds=dataSources, rra=roundRobinArchives, start=920804400)
myRRD.create()
Executing the above code, gives this error
rrdtool create test.rrd --start 920804400 --step 300 DS:speed:COUNTER:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10
Traceback (most recent call last):
File "test.py", line 10, in <module>
myRRD.create()
File "build/bdist.linux-x86_64/egg/pyrrd/rrd.py", line 175, in create
File "build/bdist.linux-x86_64/egg/pyrrd/backend/external.py", line 49, in create
File "build/bdist.linux-x86_64/egg/pyrrd/backend/external.py", line 21, in _cmd
pyrrd.exceptions.ExternalCommandError: /bin/sh: 1: rrdtool: not found
I am new to rrd tool. Kindly Help me to fix this. Thanks in advance.
Upvotes: 0
Views: 187
Reputation: 900
You've described two different ways to create rrd file: one through the python package pyrrd, and one using the command-line tool, named rrdtool.
You don't need to use both - if you want to create the file using the python script, just run it like a regular script.
When you download pyrrd with apt-get (on ubuntu), it downloads also the cmd tool, while if you download it using pip, it downloads only the python package.
Since using your code on my environment work (no special PYTHONPATH configuration), I assume you have some installation problem, try re-installing, or installing the cmd tool separately.
Upvotes: 0