Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RRD files - http://javascriptrrd.sourceforge.net/index.html #610

Open
s-a-j42 opened this issue Feb 13, 2017 · 8 comments
Open

RRD files - http://javascriptrrd.sourceforge.net/index.html #610

s-a-j42 opened this issue Feb 13, 2017 · 8 comments
Labels

Comments

@s-a-j42
Copy link

s-a-j42 commented Feb 13, 2017

Hi, I JavaMelody is great. Have you come across javascriptrrd? It is very good at creating interactive graphs from RRD files.

Are JavaMelody rrd files standard rrd? I've tried setting up javascriptrrd graphs but I am getting "wrong magic id". I've used javascriptrrd successfully with other rrd files a few times.

Thanks

@evernat
Copy link
Member

evernat commented Feb 14, 2017

I did not know javascriptrrd, thanks.
For reference, here is another one which can display graphs from RRD files: rrdgraph-js, https://github.com/terenn/rrdgraph-js which uses D3.js instead of Flot charts.
I suppose that the 2 JS tools expect RRD files format like with RRDTool.

And the cause of the error is probably because javamelody uses jrobin 1.5.9, which does not use the same rrd files format as the original RRDTool. In fact, the original RRDTool itself does not use a unique "standard" format: the RRD files format of RRDTool is not portable: http://oss.oetiker.ch/rrdtool-trac/wiki/PortableRrdFormat
For comparison, RRD files from javamelody / jrobin are portable between HW/OS.

But there exists a tool called jrrd which is supposed to convert jrobin rrd files to xml and then xml to rrdtool rrd files:
See https://wiki.opennms.org/wiki/Converting_JRobin_to_RRDtool_file_format
and source at https://github.com/OpenNMS/opennms/tree/develop/opennms-tools/jrb-to-rrd-converter
There is a similar jrobin rrd to xml tool inside the the jrobin-1.5.9.jar file:
http://grepcode.com/file/repo1.maven.org/maven2/org.jrobin/jrobin/1.5.9/org/jrobin/core/jrrd/Main.java

You may try to convert your rrd files to see if it works better with javascript-rrd or rrdgraph-js.
Or better for us, you may try to patch javascript-rrd or rrdgraph-js to make them understand the jrobin rrd files format. That would be great.

@goldyliang
Copy link
Contributor

Possibly the rrdgraph-js can be enhanced to support RRD files generated with JRobin then it can be integrated in javamelody easily?

I posted a new issue in rrdgraph project:
terenn/rrdgraph-js#15

@ratherDashing
Copy link

I've tried every rrd tool on the planet including the ones listed by evernat but every single one is saying that the javamelody rrd files are not in a proper format. what tool does every one use to read these files? Every single rrd file is 34k which is suspicious as well.

@evernat
Copy link
Member

evernat commented Jan 23, 2018

@ratherDashing
as written above, javamelody uses jrobin 1.5.9 to write rrd files

@ratherDashing
Copy link

Problem I'm experiencing is that jrobin 1.5.9 doesn't seem to be able to parse the .rrd files that are generated.

java -cp jrobin-1.5.9.jar org.jrobin.core.jrrd.Main systemCpuLoad.rrd
java.io.IOException: Invalid RRD file
at org.jrobin.core.jrrd.RRDFile.initDataLayout(RRDFile.java:58)
at org.jrobin.core.jrrd.RRDFile.(RRDFile.java:40)
at org.jrobin.core.jrrd.RRDatabase.(RRDatabase.java:59)
at org.jrobin.core.jrrd.RRDatabase.(RRDatabase.java:47)
at org.jrobin.core.jrrd.Main.(Main.java:27)
at org.jrobin.core.jrrd.Main.main(Main.java:56)

@BuildMonkey
Copy link

I agree with ratherDashing. I am getting the same error when I try to read one of the rrd files, usedMemor.rrd

$ java -cp jrobin-1.5.9.jar org.jrobin.core.jrrd.Main usedMemory.rrd
java.io.IOException: Invalid RRD file
at org.jrobin.core.jrrd.RRDFile.initDataLayout(RRDFile.java:58)
at org.jrobin.core.jrrd.RRDFile.(RRDFile.java:40)
at org.jrobin.core.jrrd.RRDatabase.(RRDatabase.java:59)
at org.jrobin.core.jrrd.RRDatabase.(RRDatabase.java:47)
at org.jrobin.core.jrrd.Main.(Main.java:27)
at org.jrobin.core.jrrd.Main.main(Main.java:56)

@evernat
Copy link
Member

evernat commented Feb 1, 2018

@BuildMonkey @ratherDashing
JRobin 1.5.9 works when used as intended (but not compatible that way with Java 9 or later). You can use commands in the included jrobin console: java -jar jrobin-1.5.9.jar, with RRDTool 1.0.x like syntax. Some commands, for example:

last usedMemory.rrd
info usedMemory.rrd
fetch usedMemory.rrd AVERAGE
dump usedMemory.rrd
etc

or in your own java program:

double lastValue = new org.jrobin.core.RrdDb(new File("usedMemory.rrd")).getLastDatasourceValue("usedMemory");

Attached is a zip with a sample usedMemory.rrd file produced with javamelody:
usedMemory.rrd.zip

@evernat
Copy link
Member

evernat commented May 1, 2020

I have also added dump as xml or txt from the browser for the next release (1.83), see doc. A snapshot build is at http://javamelody.org/downloads/javamelody-core-1.83.0-SNAPSHOT.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants