Using rrd4j, how can I combine several .rrd
files either into a single .rrd
or (ideally) to a single graph?
More details:
I have several copies of essentially the same .rrd
. Each file records several sensor data readings, all with the name sensor-1
, sensor-2
across files. So data1.rrd
, data2.rrd
will all contain data sources of sensor-1
etc.
The DS definition is as follows.
DS:sensor-1:GAUGE:35:U:U DS:sensor-2:GAUGE:35:U:U DS:sensor-3:GAUGE:35:U:U
I can generate a graph for each individually by adding a data source to a graph like this;
val graph = new RrdGraphDef()
graph.datasource("sensor-1", data1.rrd", "sensor-1", AVERAGE)
graph.datasource("sensor-2", data1.rrd", "sensor-1", AVERAGE)
graph.line("sensor-1", green)
graph.line("sensor-2", red)
but if I do the same but for data2.rrd
(adding another datasource to the same graph
instance), it seems to loose the preceding data and graphs just one of the file's data.
I suspect that each DS having the same name across files may be a problem.
Suggestions on how to achieve the same with regular RRD tool might also be helpful as I might be able to translate to rrd4j