View rrd4j persistence data

(Max Tillberg) #1

I need to export the data in my rrd4j files to some readable format like CSV, XLS (or anything at all). I have tried REST API, rrdtool but still no luck. Any help would be useful.


(Jürgen Baginski) #2

Look into the REST API, using that it should be possible to retrieve the data. I have used it to display the data, using the posted commands on the console should be possible as well.
What did you try with the REST API that made you say it isn’t working for you?

(Jürgen Baginski) #3

I just used the Request URL that gets displayed when doing a request on the GET /persistence/items/itemname page.
That request gave back the json for all values matching the item name requested for the requested timeframe You just need to get the values out of that json string!

(Max Tillberg) #4

Sounds great. Could you provide some information how to do this? I am kind of new to many thing, not only databases.


(Jürgen Baginski) #5

Getting the values readable I showed above. What are you trying to do with those values? Are you familiar with the way rrd4j keeps the data? Serveral archives, all starting now and going back different timeframes.

(Rich Koshak) #6

@christoph_wempe wrote a tool that extracts values from persistence through the REST API and inserts them into InfluxDB. You could change the InfluxDB part to instead write out to CSV.

Although if you just want to see the values, the first part shows the REST commands to get the DB values in JSON format.

(Max Tillberg) #7

I installed REST API and made a Request URL (http://openhabianpi:8080/rest/persistence) that gave me a Response Body that indicated that I have rrd4j. That is nice. When I try http://openhabianpi:8080/rest/persistence/items?serviceId=rrd4j I get an empty Response Body []. I thought I get a list of all the items that is logged. Any ideas?


(Rich Koshak) #8

Hmmmmm. I’m seeing the same behavior. I wonder if that call has not been implemented yet or if there is a bug.

You should get a list of all the Items that are persisted. I’m not sure what is going on.

(Max Tillberg) #9

Ok, I tried to use get /persistence/items/{itemname} with the following settings:
serviceId: rrd4j
itemname: FoobotTemp1 (I am not sure that this is a valid item name but I got it from the chart in HabPanel)
starttime: 2017-10-01T00:00:00
endtime: 2017-10-02T00:00:100
The problem is that I get the following answer
“error”: {
“http-code”: 500,
“exception”: {
“class”: “java.lang.NullPointerException”
Any ideas, is the item name wrong and if that is the case, how to I find them?

Sincerely Max

(Rich Koshak) #10

Item name is one of your Items so you should be able to see it in your .items files or PaperUI. You should also have the Items listed in your .persist files unless you are using Groups to define your persistence.

(Max Tillberg) #11

Thanks a lot. I have the data!