Community discussions

MikroTik App
 
santiagoimpulsar
just joined
Topic Author
Posts: 2
Joined: Mon Apr 01, 2013 6:44 pm

export history graph to excel

Mon Apr 01, 2013 9:03 pm

How can i export de "values" where the dude take it to make the graphics?

-----
Como puedo exportar los valores de donde el Dude toma para hacer los graficos.
Necesito exportar esos valores a un excel.
saludos
 
WitherVoice
just joined
Posts: 5
Joined: Wed Mar 30, 2016 1:27 pm

Re: export history graph to excel

Fri Apr 01, 2016 1:40 pm

I would also like to know this.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: export history graph to excel

Fri Apr 01, 2016 10:51 pm

The data is xml but it is compressed in the database. There are tools to access the database but no one has reported unzipiping and exporting the RRD tables in there.
 
WitherVoice
just joined
Posts: 5
Joined: Wed Mar 30, 2016 1:27 pm

Re: export history graph to excel

Wed Apr 06, 2016 12:21 pm

I've resorted to trying to write a small program that contacts the Dude application on the router and asks for the data... sadly, I've not had much luck with that, either, as of yet. The pox on whoever decided not to offer an Excel or CSV export for the data, says I.
 
WitherVoice
just joined
Posts: 5
Joined: Wed Mar 30, 2016 1:27 pm

Re: export history graph to excel

Wed Apr 06, 2016 2:15 pm

So question. Does anyone know where the history data resides? As far as I can tell, it "must" live in the Dude server app in RouterOS. Can anyone confirm that the data is not in fact stored by RouterOS itself, but rather by the Dude?
 
WitherVoice
just joined
Posts: 5
Joined: Wed Mar 30, 2016 1:27 pm

Re: export history graph to excel

Fri Apr 08, 2016 10:36 am

So question. Does anyone know where the history data resides? As far as I can tell, it "must" live in the Dude server app in RouterOS. Can anyone confirm that the data is not in fact stored by RouterOS itself, but rather by the Dude?
Okay, so shutting off the dude server app (or whatever one'd call it) stops history data collection. I'd say that's pretty definitive.

I still, however, can't make the damn thing talk to me and hand the data over. I would have loved to have more information about how to achieve this, but while I won't claim to be a very experienced developer, this is being unduly difficult, I feel. If the program was on a Linux or Windows machine, I would have far more tools to try, and the (I believe) SQLite database would eventually have to reveal its secrets. Thus far, however, RouterOS seems a far less... friendly environment under which to work.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: export history graph to excel

Mon Apr 11, 2016 5:05 pm

In windows the file is \\cworks1\Cworks1-C\Program Files\Dude\data\dude.db

The Database is in single user mode so you must stop the dude process to open the database. Just copy the database off to a work area and restart your collector...

Once you have the database you can install an sqlite plugin for firefox or you can use a sqlite command line tool to examine the database. You can perform pretty much any database thing like vacuum but then you still need to determine how to extract the RRD data. To understand RRD data just google it. This process would be much simpler to start with a dude 3.6 server since the data is only XML. After you have collected some data in 3.6 and determined the structure of the data in the XML files you can start looking for that structure inside the database. If the tables are actually compressed there is must be some decompression tool that you could add to your sqlite setup but I have never tried it. I remember someone saying it was zip format being used but there wasn't any actual detail on how. I don't remember if Normis ever chimed in about this.

There was an excellent script made by someone who extracted data using the web server but that doesn't exist in the 6x version.

You should search the forum for vacuum, sqlite, dude.db, and maybe compression that could help you find the other posts about the dude.db. I am certain that users of the dude would love to see someone access the database.

Lebowski
 
WitherVoice
just joined
Posts: 5
Joined: Wed Mar 30, 2016 1:27 pm

Re: export history graph to excel

Wed Apr 13, 2016 11:51 am

(clever and informative stuff)

Lebowski
Right, that was actually really helpful. I've gotten my hand on the raw data now. All, of course, is still not entirely rosy... the data is structured in such a way as to make me pretty sad.

I'm not entirely sure yet whether the programmers of The Dude have slightly bastardized the way RRD works because of constraints in RRD or whether they just chose what was to them a quick solution... but the data which should, by rights, be a simple set of timestamp and value, are instead a simple set of "timestamp and data source/device ID combined in a not-entirely-obvious way" and value. So now I need to try and decipher the time and the ID thing.

If I manage to get this sorted out, I'll try to write a program snippet that sorts this and post it here.

WitherVoice
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: export history graph to excel

Wed Apr 13, 2016 5:04 pm

That would be really great. Another way to see the RRD data in 3.6 is to add the graph to a chart then inside the properties of the graph you can find the detail. I don't think this will help much but it is there.