[rrd-users] Inconsistencies with invalid characters on DS names

Alejandro Galue agalue at opennms.org
Wed Aug 21 17:17:11 CEST 2013


Hello All,

I've found something interesting about the DS names.

Based on the rrdcreate command, the period character is invalid for DS names. I mean, the following command is going to generate an error:

$ rrdtool create temperature.rrd --step 300 DS:temp.kelvin:GAUGE:600:-273:5000 RRA:AVERAGE:0.5:1:100
ERROR: Invalid DS name

So, I did the following:

1) Create the RRD with a valid name:

$ rrdtool create temperature.rrd --step 300 DS:temp:GAUGE:600:-273:5000 RRA:AVERAGE:0.5:1:100
$ rrdtool info temperature.rrd 
filename = "temperature.rrd"
rrd_version = "0003"
step = 300
last_update = 1377095699
header_size = 584
ds[temp].index = 0
ds[temp].type = "GAUGE"
ds[temp].minimal_heartbeat = 600
ds[temp].min = -2.7300000000e+02
ds[temp].max = 5.0000000000e+03
ds[temp].last_ds = "U"
ds[temp].value = 0.0000000000e+00
ds[temp].unknown_sec = 299
rra[0].cf = "AVERAGE"
rra[0].rows = 100
rra[0].cur_row = 35
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0

2) Dump the RRD into XML:

$ rrdtool dump temperature.rrd > temperature.xml

3) Manually edit the XML file and change the DS name from "temp" to "temp.kelvin" and save it.

4) Restore the XML into a new RRD:

$ rrdtool restore temperature.xml temperature-2.rrd
$ rrdtool info temperature-2.rrd 
filename = "temperature-2.rrd"
rrd_version = "0003"
step = 300
last_update = 1377096600
header_size = 584
ds[temp.kelvin].index = 0
ds[temp.kelvin].type = "GAUGE"
ds[temp.kelvin].minimal_heartbeat = 600
ds[temp.kelvin].min = -2.7300000000e+02
ds[temp.kelvin].max = 5.0000000000e+03
ds[temp.kelvin].last_ds = "120"
ds[temp.kelvin].value = 0.0000000000e+00
ds[temp.kelvin].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 100
rra[0].cur_row = 4
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0

As you can see, the temperature-2.rrd was created successfully and it has a DS that is supposed to be invalid ;)

I can perform rrdupdates without issues against temperature-2.rrd, and I can fetch the data from it:

$ perl -e 'print time - (time % 300) + 300, "\n"'
1377096600
$ rrdtool update temperature-2.rrd 1377096600:100
$ rrdtool update temperature-2.rrd 1377096900:110
$ rrdtool update temperature-2.rrd 1377097200:120
$ rrdtool update temperature-2.rrd 1377097500:130
$ rrdtool update temperature-2.rrd 1377097800:140
$ rrdtool fetch temperature-2.rrd AVERAGE --start 1377096300 --end 1377097800 
                    temp.kelvin

1377096600: nan
1377096900: 1.1000000000e+02
1377097200: 1.2000000000e+02
1377097500: 1.3000000000e+02
1377097800: 1.4000000000e+02
1377098100: nan

But, I can't graph the data:

$ rrdtool graph temperature.pnd  --start 1377096300 --end 1377097800 --title="Temperature" DEF:temp=temperature-2.rrd:temp.kelvin:AVERAGE LINE:temp#ff0000:Temp
ERROR: Cannot parse DS in 'DEF:temp=temperature-2.rrd:temp.kelvin:AVERAGE'

So, it seems that rrdcreate and rrdgraph are consistent, but I guess that this also means that rrdrestore is not validating the DS names, and should generate a similar error to be consistent. Is that correct?

Considering that temperature-2.rrd is working in terms of restoring, updating and fetching the data, why the period character is invalid ? Are there other invalid characters ?

Alejandro.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130821/a83bec91/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130821/a83bec91/attachment-0001.pgp 


More information about the rrd-users mailing list