The validate_rrd function finds 8.642135e+130 at offset 16, which makes it think the rrd is 64bit, which it isn't.
According to http://oss.oetiker.ch/rrdtool-trac/wiki/PortableRrdFormat it should be simple to convert a mips rrd file to an x86 one using these two macros:
Would you mind creating another RRD on the same machine, but one that has at least 3 DS's?
I am trying to figure out the structure, and the DB name block does not make sense… seeing a few may help.
Thanks,
Igor
PS: You are not using a custom rrdtool, build, right?
(i.e., modified source code)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Whoops, my bad! I created this with an old version of the lib, which must have been 1.0, but also vanilla. I updated the files on my webserver, the links are the same as in the last post.
Regards,
Alexander
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't know if this is already known or even relevant, but I just wanted to let you kno the library also seems to work with RRDs generated on the raspberry pi.
Cheers,
Alexander
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to use this library with RRD files created on the FritzBox 7390, which uses an Ikanos Fusiv Core (MIPS 24Kc V4.12) processor, and all I am getting are messages about the Magic number at 16. The device is running RRDtool v1.2.30.
Attached is an example of an RRD file generated on that device, which is giving me errors with the JavascriptRRD libraries, can anything be done about it?
Aloha, an interesting factoid on a related matter is below. Igor, I'm guessing you don't want to monkey with javascriptrrd for rrd_version 1 files for MIPS. I'll gladly take a patch if you wanted to chew on this (I can get you test files), but I've worked around.
I am using openwrt Attitude Adjustment (waiting for Chaos Calmer to come out), and was having a ton of problems with rrd files produced with the collectd-mod-rrdtool and librrd1 packages (rrdtool 1.0.50). I run a D-link DIR-825 B1 (Atheros AR7161 rev 2, MIPS 24Kc V7.4).
The observation was that my rrd plots with javascriptrrd had ping values like 1.234e+123, i.e. wickedly out of range. I confirmed it was just an endian/alignment/... issue by rrdtool dump/restoring the file. Then I found this thread :) And spent one heck of a long time digging into javascriptrrd's source code twiddling with switch_endian in various places. I couldn't get it to work at all.
Long story short, I found that Rami's file was rrd_version 3 whereas mine were rrd_version 1. Being naughty, I gave my openwrt a good kick to move to a modern librrd:
opkg remove --force-depends librrd1 rrdtool1
opkg install librrd rrdtool
cd /usr/lib
ln -s librrd.so.2.0.15 librrd.so
ln -s librrd.so.2.0.15 librrd.so.0
ln -s librrd_th.so.2.0.15 librrd_th.so
ln -s librrd_th.so.2.0.15 librrd_th.so.0
And this fixed everything. Openwrt prefers the ancient librrd apparently because 1.2.x is "much larger", I presume in disk which is hard-to-find on most routers (I have extra storage).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
is there any way support for this will be added anytime soon?
Regards,
Alexander
I dug up a bit more info:
The validate_rrd function finds 8.642135e+130 at offset 16, which makes it think the rrd is 64bit, which it isn't.
According to http://oss.oetiker.ch/rrdtool-trac/wiki/PortableRrdFormat it should be simple to convert a mips rrd file to an x86 one using these two macros:
#define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
(((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
(((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
(((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
(((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
(((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
(((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
(((uint64_t)(A) & 0x00000000000000ffLL) << 56))
#define mips2x86(A) ((uint64_t)(A) == 0x7fffffffffffffffLL \
? 0x000000000000f87fLL \
: endianflip(A))
Unfortunately my coding skills are insufficient to implement it myself.
Yes, should not be too difficult.
But I will need a RRD to test it against.
Can you please provide one?
Thanks,
Igor
Sure thing. Here it is: http://www.arles-electrique.de/mips.rrd
This one does not seem to be created on MIPS.
The magic double number in the header uses the same encoding as AMD64:
Can you print out what
shows on the machine that created the file?
That would help decoding the file.
Thanks,
Igor
sure:
One more thing.
Would you mind creating another RRD on the same machine, but one that has at least 3 DS's?
I am trying to figure out the structure, and the DB name block does not make sense… seeing a few may help.
Thanks,
Igor
PS: You are not using a custom rrdtool, build, right?
(i.e., modified source code)
Here you go:
http://www.arles-electrique.de/smartmeter.rrd and
http://www.arles-electrique.de/smartmeter.rrd.info
And no, I'm using the vanilla rrdtool 1.2.30 buid on openwrt.
Regards,
Alexander
Cannot be "vanilla 1.2.30".
The rrd version should be "0003", not "0001"!
I will still try to figure out what's going inside this file, but you should sort out things on your side as well!
Igor
Whoops, my bad! I created this with an old version of the lib, which must have been 1.0, but also vanilla. I updated the files on my webserver, the links are the same as in the last post.
Regards,
Alexander
OK, I think I have nailed it.
The code have been committed to CVS.
The only essential change is in
javascriptrrd/v0/src/lib/rrdFile.js
It seems to work, but I would appreciate you trying it out, too and confirming it indeed works for you.
Cheers,
Igor
I only ran a few tests with the example scripts but so far it looks as if everything is working.
Thanks a lot for your help, now I don't have to generate csv files with a shell script every minute any more ;)
Cheers,
Alexander
Hi again,
I don't know if this is already known or even relevant, but I just wanted to let you kno the library also seems to work with RRDs generated on the raspberry pi.
Cheers,
Alexander
I am trying to use this library with RRD files created on the FritzBox 7390, which uses an Ikanos Fusiv Core (MIPS 24Kc V4.12) processor, and all I am getting are messages about the Magic number at 16. The device is running RRDtool v1.2.30.
Attached is an example of an RRD file generated on that device, which is giving me errors with the JavascriptRRD libraries, can anything be done about it?
Hi Rami.
Sorry for the long absence.
Looks like you re using a different median system here.
I think I know how to fix it though...
will let you know when it is done.
Igor
OK, the head of CVS now has a fix that works with your example rrd file.
Please test it, if you can.
Will wait a few more days before cutting a new release.
Hello Igor,
The new version is working perfectly with the RRD files I have.... THANKS A LOT....
Aloha, an interesting factoid on a related matter is below. Igor, I'm guessing you don't want to monkey with javascriptrrd for rrd_version 1 files for MIPS. I'll gladly take a patch if you wanted to chew on this (I can get you test files), but I've worked around.
I am using openwrt Attitude Adjustment (waiting for Chaos Calmer to come out), and was having a ton of problems with rrd files produced with the collectd-mod-rrdtool and librrd1 packages (rrdtool 1.0.50). I run a D-link DIR-825 B1 (Atheros AR7161 rev 2, MIPS 24Kc V7.4).
The observation was that my rrd plots with javascriptrrd had ping values like 1.234e+123, i.e. wickedly out of range. I confirmed it was just an endian/alignment/... issue by rrdtool dump/restoring the file. Then I found this thread :) And spent one heck of a long time digging into javascriptrrd's source code twiddling with switch_endian in various places. I couldn't get it to work at all.
Long story short, I found that Rami's file was rrd_version 3 whereas mine were rrd_version 1. Being naughty, I gave my openwrt a good kick to move to a modern librrd:
opkg remove --force-depends librrd1 rrdtool1
opkg install librrd rrdtool
cd /usr/lib
ln -s librrd.so.2.0.15 librrd.so
ln -s librrd.so.2.0.15 librrd.so.0
ln -s librrd_th.so.2.0.15 librrd_th.so
ln -s librrd_th.so.2.0.15 librrd_th.so.0
And this fixed everything. Openwrt prefers the ancient librrd apparently because 1.2.x is "much larger", I presume in disk which is hard-to-find on most routers (I have extra storage).