Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[HOWTO] Scripts to migrate RRDs from Win32 to Linux

 
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's
Author Message
cpt_ahab
Cacti User


Joined: 01 Feb 2005
Posts: 60

PostPosted: Thu Sep 28, 2006 7:15 am    Post subject: [HOWTO] Scripts to migrate RRDs from Win32 to Linux Reply with quote

Here are my scripts for ex- and importing the RRD files to my new linux-cacti box

They are very dirty but they work.

On the win32 side
open a file
put this line into it

Code:
FOR /R E:\your\path\to\cacti\rra %%f IN (*.*) DO rrdtool dump %%f > %%f.xml

save it as export.bat in you cacti/rra folder and run the script.
it produces files like <ds-name>.rrd.xml. it will produce some errors for files in the rra-folder that arent rrd-files. but this is no problem.

afterwards mount the windows-folder in your linux box
edit the following script for your needs

mounted is the folder where your cacti/rra Folder is mounted
cactipath is where your new rra-folder is on your linuxbox.

Code:
#!/bin/bash
#import xml 2 rrd
cactipath='/your/path/to/cacti/rra'
mounted='/mnt/somedrive'
files=$(ls $mounted | grep .xml | cut -d "." -f 1 )
for i in $files; do
        rrdtool restore "$mounted/$i.rrd.xml" "$cactipath/$i.rrd"
        echo "$i.xml nach $cactipath/$i.rrd importiert"
done


run the script and you are done
your rrd-files should be in your cacti/rra folder

greez jan


Last edited by cpt_ahab on Wed Dec 20, 2006 7:17 am; edited 1 time in total
Back to top
rony
Developer/Forum Admin


Joined: 17 Nov 2003
Posts: 5453
Location: Wisconsin, USA

PostPosted: Sat Sep 30, 2006 10:02 pm    Post subject: Reply with quote

I have been thinking about writing a nice set of scripts that will do this work either live or in batch from and to win32/64, linux32/64, OSX, Freebsd32/64 and etc....

Haven't the time...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group