[HOWTO] Debug NaN's in your graphs

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Moderators, Developers

Author
Message
pbud70
Posts: 5
Joined: Mon Oct 10, 2016 7:25 pm

Re: [HOWTO] Debug NaN's in your graphs

#16 Post by pbud70 » Mon Aug 14, 2017 5:40 pm

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

Erudes1991
Posts: 16
Joined: Thu Feb 28, 2019 12:37 am

Re: [HOWTO] Debug NaN's in your graphs

#17 Post by Erudes1991 » Thu Feb 28, 2019 5:44 pm

I cannot follow these steps, they are quite difficult to me, can you guys provide me assistance?

Post Reply