Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Sep 24, 2018 2:35 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: [HOWTO] Debug NaN's in your graphs
PostPosted: Mon Aug 14, 2017 5:40 pm 
Offline

Joined: Mon Oct 10, 2016 7:25 pm
Posts: 5
OK, got it with the excellent help of the folks @ ITPA www.ipta.org.au . Basically the data value that I was putting in had a trailling \r\n. Finding this out was done with…

[email protected]:~# 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 second 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.

Cheers,

Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group