java - Combine separate RRD files to a single graph -
using rrd4j, how can combine several .rrd
files either single .rrd
or (ideally) single graph?
more details:
i have several copies of same .rrd
. each file records several sensor data readings, name sensor-1
, sensor-2
across files. data1.rrd
, data2.rrd
contain data sources of sensor-1
etc.
the ds definition 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 graph each individually adding data source graph 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 same data2.rrd
(adding datasource same graph
instance), seems loose preceding data , graphs 1 of file's data.
i suspect each ds having same name across files may problem.
suggestions on how achieve same regular rrd tool might helpful might able translate rrd4j
this statement: graph.datasource("varname", "filename.rrd", "dsname", average)
defines new variable use called varname
, corresponds ds dsname
in file filename.rrd
, consolodated using average
consolodation function.
clearly, cannot have 2 variables in same graph same name; however, there nothing prevent pulling data multiple different rrd files, , nothing prevent using different varname ds name.
however, should use alphanumerics in variable name -- in particular, avoid '-', though supposed work. underscores ok.
so, valid: graph.datasource("sensora", "sitea.rrd", "sensor", average) graph.datasource("sensorb", "siteb.rrd", "sensor", average)
, define 2 variables, sensora
, sensorb
corresponding same named ds in 2 different rrd files.
do not use sensor-1
varname, contains '-' symbol.
not having seen rrd4j code failing can't certain, suspect either because not renaming varname, making both variables share same name , overwrite 1 another, or because of '-' in varname.
Comments
Post a Comment