[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rrd-users
Subject:    [rrd-users] Inconsistencies with invalid characters on DS names
From:       Alejandro Galue <agalue () opennms ! org>
Date:       2013-08-21 15:17:11
Message-ID: 688B3A43-8764-4875-AD74-D03F26A114CD () opennms ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/alternative)]


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.


[Attachment #7 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space; ">Hello \
All,<div><br></div><div><div>I've found something interesting about the DS \
names.</div><div><br></div><div>Based on the rrdcreate command, the period character \
is invalid for DS names. I mean, the following command is going to generate an \
error:</div></div><div><br></div><div><font face="Courier"><span style="font-size: \
14px; ">$ rrdtool create temperature.rrd --step 300 \
DS:temp.kelvin:GAUGE:600:-273:5000 \
RRA:AVERAGE:0.5:1:100</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">ERROR: Invalid DS \
name</span></font></div><div><br></div><div>So, I did the \
following:</div><div><br></div><div>1) Create the RRD with a valid \
name:</div><div><br></div><div><font face="Courier"><span style="font-size: 14px; ">$ \
rrdtool create temperature.rrd --step 300 DS:temp:GAUGE:600:-273:5000 \
RRA:AVERAGE:0.5:1:100</span></font></div><div><div><font face="Courier"><span \
style="font-size: 14px; ">$ rrdtool info \
temperature.rrd&nbsp;</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">filename = "temperature.rrd"</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">rrd_version = \
"0003"</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">step = 300</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">last_update = 1377095699</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">header_size = 584</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">ds[temp].index = \
0</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">ds[temp].type = "GAUGE"</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">ds[temp].minimal_heartbeat = \
600</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">ds[temp].min = -2.7300000000e+02</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">ds[temp].max = \
5.0000000000e+03</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">ds[temp].last_ds = "U"</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">ds[temp].value = \
0.0000000000e+00</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">ds[temp].unknown_sec = 299</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">rra[0].cf = "AVERAGE"</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">rra[0].rows = \
100</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">rra[0].cur_row = 35</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">rra[0].pdp_per_row = 1</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">rra[0].xff = \
5.0000000000e-01</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">rra[0].cdp_prep[0].value = NaN</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">rra[0].cdp_prep[0].unknown_datapoints \
= 0</span></font></div></div><div><br></div><div>2) Dump the RRD into \
XML:</div><div><br></div><div><font face="Courier"><span style="font-size: 14px; ">$ \
rrdtool dump temperature.rrd &gt; \
temperature.xml</span></font></div><div><br></div><div>3) Manually edit the XML file \
and change the DS name from "temp" to "temp.kelvin" and save \
it.</div><div><br></div><div>4) Restore the XML into a new \
RRD:</div><div><br></div><div><font face="Courier"><span style="font-size: 14px; ">$ \
rrdtool restore temperature.xml temperature-2.rrd</span></font></div><div><div><font \
face="Courier"><span style="font-size: 14px; ">$ rrdtool info \
temperature-2.rrd&nbsp;</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">filename = \
"temperature-2.rrd"</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">rrd_version = "0003"</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">step = \
300</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">last_update = 1377096600</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">header_size = 584</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">ds[temp.kelvin].index = \
0</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">ds[temp.kelvin].type = "GAUGE"</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">ds[temp.kelvin].minimal_heartbeat = \
600</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">ds[temp.kelvin].min = -2.7300000000e+02</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">ds[temp.kelvin].max = \
5.0000000000e+03</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">ds[temp.kelvin].last_ds = "120"</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">ds[temp.kelvin].value = \
0.0000000000e+00</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">ds[temp.kelvin].unknown_sec = 0</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">rra[0].cf = \
"AVERAGE"</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">rra[0].rows = 100</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">rra[0].cur_row = 4</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">rra[0].pdp_per_row = \
1</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">rra[0].xff = 5.0000000000e-01</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">rra[0].cdp_prep[0].value = \
NaN</span></font></div><div><font face="Courier"><span style="font-size: 14px; \
">rra[0].cdp_prep[0].unknown_datapoints = \
0</span></font></div></div><div><br></div><div>As you can see, the temperature-2.rrd \
was created successfully and it has a DS that is supposed to be invalid \
;)</div><div><br></div><div><div>I can perform rrdupdates without issues against \
temperature-2.rrd, and I can fetch the data from \
it:</div><div><br></div><div><div><font face="Courier"><span style="font-size: 14px; \
">$ perl -e 'print time - (time % 300) + 300, "\n"'</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; \
">1377096600</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">$ rrdtool update temperature-2.rrd \
1377096600:100</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">$ rrdtool update temperature-2.rrd \
1377096900:110</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">$ rrdtool update temperature-2.rrd \
1377097200:120</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">$ rrdtool update temperature-2.rrd \
1377097500:130</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">$ rrdtool update temperature-2.rrd \
1377097800:140</span></font></div><div><div><font face="Courier"><span \
style="font-size: 14px; ">$ rrdtool fetch temperature-2.rrd AVERAGE --start \
1377096300 --end 1377097800&nbsp;</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; temp.kelvin</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; "><br></span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">1377096600: nan</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">1377096900: \
1.1000000000e+02</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">1377097200: 1.2000000000e+02</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">1377097500: \
1.3000000000e+02</span></font></div><div><font face="Courier"><span style="font-size: \
14px; ">1377097800: 1.4000000000e+02</span></font></div><div><font \
face="Courier"><span style="font-size: 14px; ">1377098100: \
nan</span></font></div></div></div><div><br></div><div>But, I can't graph the \
data:</div></div><div><br></div><div><div><font face="Courier"><span \
style="font-size: 14px; ">$ rrdtool graph temperature.pnd &nbsp;--start 1377096300 \
--end 1377097800 --title="Temperature" DEF:temp=temperature-2.rrd:temp.kelvin:AVERAGE \
LINE:temp#ff0000:Temp</span></font></div><div><font face="Courier"><span \
style="font-size: 14px; ">ERROR: Cannot parse DS in \
'DEF:temp=temperature-2.rrd:temp.kelvin:AVERAGE'</span></font></div></div><div><br></div><div><div>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?</div><div><br></div><div>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 \
?</div></div><div><br></div><div>Alejandro.</div><div><br></div></body></html>


["signature.asc" (signature.asc)]

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJSFNn3AAoJEIevly7a+L4spRcH+wQw8ZzTpmxgWDa6RcpVVlFf
EsxMYYXPByqUaVHT1E94Kf5sP2JoTEJoOuO6HMqiTNAfq1dCe436BTlZcvcAID0S
wALTWBQJg8Tz0vpy2dQLSrsJu6WwD89fj2s3eKWnZI/84AZ1sYQ4lZO9T0hXN25T
c0jIG/2alNq74AKgOuPxn47tpIa9KT8aO7M300eD2eqVtmvpi9OiKzjhXMf1o8ey
p6AidODmVP7J/Z6eL7fwvOpDbLBoMkKWbCsf/IEaCaZePeLZtGmssD2z5qRgwsO+
XP1knNmcW+7adAJAswuaoRi3murum2AX7vNWMAJEnCi4w0L5g0Cf44UNzcxCoSU=
=4//h
-----END PGP SIGNATURE-----


_______________________________________________
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic