Can't get rid of NaN in rrd / rra

Chris Herrmann <[email protected]> Mon, 14 Aug 2017 22:39:23 +0000
Newsgroups gmane.comp.db.rrdtool.user
Message-ID <SYXPR01MB17269B013B3EDD6A8B52A604B58C0@SYXPR01MB1726.ausprd01.prod.outlook.com>
--===============7389854866126623656==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_SYXPR01MB17269B013B3EDD6A8B52A604B58C0SYXPR01MB1726ausp_"

--_000_SYXPR01MB17269B013B3EDD6A8B52A604B58C0SYXPR01MB1726ausp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

OK, got it with the excellent help of the folks @ ITPA www.ipta.org.au<http=
://www.ipta.org.au> . Basically the data value that I was putting in had a =
trailling \r\n. Finding this out was done with...

root@whisk:~# echo "$myvar" | od -a
0000000 0 . 7 8 cr nl
0000006

and:
printf "%f" "$myvar"
: invalid number.78
0.000000

This occurred because it was the last field (column) in the file, so "cut" =
was grabbing the carriage return as part of the last field.

I fixed it by adding an additional dummy field to the returned sql, so that=
 instead of grabbing the last field in the data set I'm now grabbing the se=
cond last field.

So now I get:
echo "$myvar" | od -a
0000000 b nul fs 0 . 7 8 b nul gs nl
0000013

now which works OK and there's aggregate data appearing in rrds now.

--
Regards

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au


--_000_SYXPR01MB17269B013B3EDD6A8B52A604B58C0SYXPR01MB1726ausp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
code
	{mso-style-priority:99;
	font-family:"Courier New";}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:"Courier New";
	mso-fareast-language:EN-AU;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-AU" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">OK, got it with the excellent help of the folks @ IT=
PA <a href=3D"http://www.ipta.org.au">
www.ipta.org.au</a> . Basically the data value that I was putting in had a =
trailling \r\n. Finding this out was done with&#8230;<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">root@whisk:~# echo &#8220;$myvar&#8221; | od -a<br>
0000000 0 . 7 8 cr nl<br>
0000006<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">and:<o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;;mso-fareast-language:EN-AU">printf &quot;%f&quot; &quot;$my=
var&quot;<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;;mso-fareast-language:EN-AU">: invalid number.78<o:p></o:p><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;;mso-fareast-language:EN-AU">0.000000<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">This occurred because it was the last field (column)=
 in the file, so &#8220;cut&#8221; was grabbing the carriage return as part=
 of the last field.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I fixed it by adding an additional dummy field to th=
e returned sql, so that instead of grabbing the last field in the data set =
I&#8217;m now grabbing the second last field.
<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">So now I get:<o:p></o:p></p>
<p class=3D"MsoNormal">echo &#8220;$myvar&#8221; | od -a<br>
0000000 b nul fs 0 . 7 8 b nul gs nl<br>
0000013<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">now which works OK and there&#8217;s aggregate data =
appearing in rrds now.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"mso-fareast-language:E=
N-AU">--<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"mso-fareast-language:E=
N-AU">Regards<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"mso-fareast-language:E=
N-AU"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"mso-fareast-language:E=
N-AU">Chris Herrmann<br>
Far Edge Technology<br>
<br>
p. 02 84251400<br>
m. 0403 393309<br>
<a href=3D"http://www.faredge.com.au"><span style=3D"color:#0563C1">http://=
www.faredge.com.au</span></a>&nbsp;&nbsp;
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_SYXPR01MB17269B013B3EDD6A8B52A604B58C0SYXPR01MB1726ausp_--


--===============7389854866126623656==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
rrd-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

--===============7389854866126623656==--