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
printf "%f" "$myvar"
: invalid number.78
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
now which works OK and there’s aggregate data appearing in rrds now.
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.