[rrd-users] rrd dbi syntx
Steve Shipway
s.shipway at auckland.ac.nz
Mon Mar 31 23:19:55 CEST 2014
>rrdtool graph
>./test.png --imgformat=PNG --start=-1day --end=+0hours --width=1000 --height=600
>"DEF:min=sql//mysql/host=127.0.0.1/dbname=thermal/username=thermal/password=thermal//temperature/date/cpu0:min:AVERAGE"
>"LINE1:min#FF0000:cpu0"
>
>Error:
>ERROR: formatstring wrong - mysql
Second attempt at a solution, since the mysql drivers are confirmed to be
present!
See the documentation here
http://oss.oetiker.ch/rrdtool/doc/rrdgraph_libdbi.en.html
Your DEF specifies that the table to use is 'temperature', with the time
coming from field 'date' and the value from field 'cpu0'.
The 'date' field needs to be a UNIX timestamp, not a datetime field type.
Prefix it with a '*' if it is a datetime field -- this requires RRDTool
1.4.something I believe.
You've not given a table definition for your 'temperature' table, but I
suspect 'date' is a datetime rather than a UNIX timestamp. Try this instead:
DEF:min=sql//mysql/host=127.0.0.1/dbname=thermal/username=thermal/password=thermal//temperature/*date/cpu0:min:AVERAGE
... and this should do the necessary datetime -> timestamp conversion.
Steve
Steve Shipway
s.shipway at auckland.ac.nz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5909 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20140331/053786b6/attachment-0001.bin
More information about the rrd-users
mailing list