migrating data history from MRTG to CACTI

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
omar
Posts: 5
Joined: Wed Sep 04, 2002 3:22 am

migrating data history from MRTG to CACTI

Post by omar »

Hi,

I used to work on MRTG and now want to migrate to cacti, I have set it up and is is running perfectly.
The problem is that I have old MRTG log files that contain data from the past two years.
How can I migrate this data to cacti.
I know I can change the log files to rrd files, but in cacti, for eache interface there is two rrd files, one for inbound and one for outbound traffic. while there is only one rrd file for the MRTG that contains both inbound and outbound traffic.
What should I do, If I cant Migrate the history, then I can't use cacti.
Please Advice.

All of my traffic is cisco routers, and there are more than 600 nods I am currently monitoring.



Thanks.

Omar
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

There is no way (to my knowledge) to make rrdtool read MTRG .log files directly. I know that MRTG is able to convert .log files to .rrd files though. I am not sure how to do this off the top of my head, but I know it can be done. I would check the MRTG/rrdtool documentation for more information about that.

Once you have the .rrd files, you can simply add them into cacti by specifying the full pathname and a data source name of 'ds0' and 'ds1' (incoming/outgoing data).

-Ian
omar
Posts: 5
Joined: Wed Sep 04, 2002 3:22 am

Post by omar »

I have imported the MRTG rrd files as you said, it worked fine,
but as soon as cron runs cmd.php, the graph and the history gets ruind.
The in/out data jump to more than 1 GB where the old history is no more than 128kb or 64kb.
If I leave MRTG to do the polling and cacti do the graphing, it works just fine, but I would prefare to let cacti collect the data and update the imported rrd.
Do you have any idea why is this happining?


Thank You.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I have a feeling this is due to an SNMP counter overflow of some sort. It is probably happening because cacti does not know where to "pick up" after MRTG left off, and it ends up overflowing the counter the first time it tries.

I don't have a great solution to this except trying to do a dump on the .rrd and seeing what the defined maximums are.

If I think of a fix, I'll let you know.

-Ian
Guest

Post by Guest »

How can I specify DS0 or DS1 using the console? By default, the console puts in DS....how to change that?
Thanks a lot,
Raju

/opt/RRDtool/bin/rrdtool create \
/var/www/html/cacti/rra/servers.rrd:ds0 \
--step 300 \
DS:servers:GAUGE:600:0:1000000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:MAX:0.5:1:600 \
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

You can specify 'ds0' or 'ds1' in the 'Internal Data Source Name' field for each data source. You would also need to specify the full path to the rrd files you are trying to graph using the 'Data Source Path' field.

-Ian
americo

mrtg log conversion...

Post by americo »

I still having problem with migrating mrtg log to rddtool (cacti).

First, i used a script log2rdd to convert the logs to rrd, its works fine, i used with ds0 (in) and ds1 (out) in my cacti system and graph the history... i think that is works.. but when cacti start to collect the data the history was erased and the numbers grow up to G... =(

Second, i convert the log files using mrtg (in cfg file used logformat: rrdtool) and think its works becuase a rrd file was generated, i used in cacti this file with ds0 and ds1, the history works fine for both (in / out) but when cacti start to collect new data, only a ds0 is collected.. why?

any idea?

thanks,
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

If you are getting values that keep incrimenting it is probably because you are using a GUAGE datasource type when you should be using a COUNTER.

About cacti only collecting data for 'ds0'... Make sure you create two data sources for each rrd file. One data source will specify 'ds0' and the other will specify 'ds1'. They will both share the same filename however.

-Ian
americo
Posts: 8
Joined: Tue Sep 17, 2002 11:07 am
Contact:

Post by americo »

I have two data source name that point to one file (xxx.rrd)

Look:

data source name: A is ds0
data source name: B is ds1
both have data source type : COUNTER and point the same file (xxx.rrd).

but only collect data from ds0....
I will do an experiment and i will tell you what happend... jejeje... i hope that works... if not... i kill my self. jejeje just I'm kidding... =)

thanks
americo
Posts: 8
Joined: Tue Sep 17, 2002 11:07 am
Contact:

Post by americo »

Im still alive... :D
Its works.. cacti collect new data, graph it and admin all my sources.

Situation: i have a lot of graphs with MRTG, and i installed cacti (rrdtool) to admin all. Important is join the history with the new data.

Solution is:
1. Convert with mrtg the log to rrd file. (xxx.rrd)
2. Copy two files from xxx.rrd to create xxx_in.rrd and xxx_out.rrd. (cp xxx.rrd xxx_in.rrd;cp xxx.rrd xxx_out.rrd)
3. In cacti create two data source name, ds0 to file xxx_in.rrd and ds1 to xxx_out.rrd.
4. Create a graph
5. Finally add the data source name created to the graph.

* both have data source type : COUNTER.

good look.
atrocity
Posts: 18
Joined: Tue Aug 26, 2003 10:04 am

Post by atrocity »

Hello,

I have problems with your procedure...
Are you still alive ?
Thanks
Best regards
Jean
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests