This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

rrdtool problem
#1
Hi,

As it is not possible to have a graph with more than one variable, I decided to make my own graphs with rrdtool.
At first I was going to use another server that would collect data with remote xlm service, create the graph, put it on a webpage and display that graph in an iframe in LM.

I had progressed up to the point of moving the graph to the web server when it occurred to me that the rrdtool package is available in LM![Image: rolleyes.png]
The new plan was then to create an rrd archive in LM, put the graph in the img directory and then use that image in my visualisation.

What I did (this is in LM4 firmware 20160714):
-create a directory /data/storage/rrd
-create a rrd archive as follows:

Code:
create_rrd = "rrdtool create /data/storage/rrd/ventilatie.rrd --start N --step 300" ..
" DS:T_intake:GAUGE:600:-20:50" ..
" DS:T_supply:GAUGE:600:-20:50" ..
" DS:T_discharge:GAUGE:600:-20:50" ..
" DS:T_exhaust:GAUGE:600:-20:50" ..
" RRA:MIN:0.5:12:1440" ..
" RRA:MAX:0.5:12:1440" ..
" RRA:AVERAGE:0.5:1:1440"
result = os.execute(create_rrd)

-update the rrd with data:

Code:
-- get data
T_intake = grp.getvalue('4/1/11')
T_supply = grp.getvalue('4/1/12')
T_discharge = grp.getvalue('4/1/14')
T_exhaust = grp.getvalue('4/1/13')
log(T_intake ..":" ..T_supply..":" ..T_discharge..":" ..T_exhaust)
rrdupdate = "rrdtool update /data/storage/rrd/ventilatie.rrd N:" ..T_intake ..":" ..T_supply ..":" ..T_discharge ..":" ..T_exhaust
result = io.readproc(rrdupdate)
-verify that data was being written with rrdtool first and rrdtool last

All this went well. I then wanted to create a graph as follows:

Code:
rrdgraph = "rrdtool  graph /data/storage/img/ventilatie.png DEF:T_i=/data/storage/rrd/ventilatie.rrd:T_intake:AVERAGE LINE1:T_i#ff0000:Invoer"
log(rrdgraph)
result = os.execute(rrdgraph)

This fails, with the os.execute statement returning 256. Obviously no graph is created.
The manual states that the return code of os.execute is system dependent. I have no idea what values to expect on LM...
On the other machine this worked without any problems. The only difference is the version of rrdtool: on LM this is 1.4.7 whereas on the other machine it is 1.6

What is going wrong here?

Thanks.
Reply


Messages In This Thread
rrdtool problem - by baggins - 12.03.2017, 22:25
RE: rrdtool problem - by admin - 13.03.2017, 07:31
RE: rrdtool problem - by baggins - 13.03.2017, 07:53
RE: rrdtool problem - by Thomas - 13.03.2017, 12:58
RE: rrdtool problem - by baggins - 13.03.2017, 15:28
RE: rrdtool problem - by baggins - 14.03.2017, 21:53
RE: rrdtool problem - by Thomas - 15.03.2017, 13:32
RE: rrdtool problem - by baggins - 15.03.2017, 15:04

Forum Jump: