MRTG to Cacti

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

Moderators: Developers, Moderators

Post Reply
Guest

MRTG to Cacti

Post by Guest »

Hi,

I have just installed cacti and would like to import all my MRTG data over. is this possible??

Thanks
blobon
Posts: 1
Joined: Thu Oct 09, 2003 7:24 pm

Post by blobon »

Hi guys,

that was me, didnt know you had to log in after registering . most forums log you in automatically after registering.
Kudithipudi
Posts: 11
Joined: Fri Jul 11, 2003 1:58 pm

Post by Kudithipudi »

I don't know of a easy way. But here is something that you can try.

1) Create all the required graphs in Cacti using the web interface.
2) Get the names of the rrd' created by Cacti
3) Export data from your MRTG rrd' by using "rrdtool dump RRD_FILENAME > XMLFILENAME.XML"
4) Import data from the XML file to the rrd that Cacti created "rrdtool restore XMLFILENAME.XML CACTI_RRD_FILENAME.RRD"

If you have all your MRTG rrds and Cacti rrds ready, maybe you can just script the above steps and do it in an automated way.

Also please make sure that you are exporting and importing as the user that runs cacti (usually cactiuser)

Hope this helps.

- V.
craigeherring
Posts: 2
Joined: Wed Mar 03, 2004 3:29 pm
Location: WI
Contact:

Post by craigeherring »

This works.... I only had to do one more step:

In the XML page I had to replace 2 lines... Right in the begining in the
<ds> >> <name> tag the names must be the same.

I had MRTG call the names ds0,ds1,ds2,... but cacti calls them based on the name you call the device.
svenXY

Post by svenXY »

Hi there,

I was hoping there was a way to use existing rrds in Cacti. I have MRTG running that creates (and will update) my rrds. I can get cacti to create a graph from one of them by creating an inactive Data source and provide the path to the rrd.

But how would I do that for ~50 hosts? How can I create a template that will read the rrd and then just use the template?

Any ideas?

Thanks,
Sven
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I suggest migrating to Cacti. However, to get your RRD's into Cacti and to make graphs, it is best to start with Hammer, Nails, Brick, and Mortar.

In other words, if you can code, best start now and contribute to the overall community what you create. If it's good, it may even make it into the mainline project.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Importing MRTG data (script)

Post by monachus »

This isn't perfect, but it works. I just spent the weekend snarfing all our old MRTG/RRD data and loading it into Cacti.

What I did was create the devices and graphs and stuff as if they were new data. I then exported the MRTG data and imported it into Cacti. I like Cacti's intelligent handling of datasource names, so I had to write something that would change ds0 and ds1 into something that cacti was expecting. You'll have to change cactiuser inside the script (it chowns after import), but everything else is a flag.

It would also work if you change a datasource name within a Cacti rrd and don't want to manually export, hack, and import.

Enjoy!
Attachments
convert.pl.txt
Quickly convert DS names inside of RRDs
(2.47 KiB) Downloaded 1244 times
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests