lists.netmrg.net lists.netmrg.net
NetMRG discussion and support
 
FAQ :: Search :: Memberlist :: Usergroups :: Register
Profile :: Log in to check your private messages :: Log in

Importing old mrtg data (howto)

 
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support
Author Message
BryanRagon
Beginner


Joined: 09 Jun 2004
Posts: 8

PostPosted: Thu Jun 10, 2004 3:27 pm    Post subject: Importing old mrtg data (howto) Reply with quote

Greetings all,

Thanks to the help on this board, I have found a way to import our old mrtg rrd data into netmrg. I believe the standard mrtg can only have two values for each rrd file that it is recording. If you track both of those values in netmrg, it will store them in two separate rrd's. Here's how to extract them. Note that you need to install xmlstartlet, available at: http://xmlstar.sf.net/.

Code:

rrdtool dump old_mrtg.rrd | xml ed -d /rrd/ds[2] | xml ed -d /rrd/rra/cdp_prep/ds[2] |xml ed -d /rrd/rra/database/row/v[2] | xml ed -u '/rrd/ds/name' -v ' mon_19 ' |sed 1d > netmrg_value1.xml
rm /var/lib/netmrg/rrd/mon_19.rrd
rrdtool restore netmrg_value1.xml /var/lib/netmrg/rrd/mon_19.rrd


and for value 2
Code:

rrdtool dump old_mrtg.rrd | xml ed -d /rrd/ds[1] | xml ed -d /rrd/rra/cdp_prep/ds[1] |xml ed -d /rrd/rra/database/row/v[1] | xml ed -u '/rrd/ds/name' -v ' mon_20 ' |sed 1d > netmrg_value1.xml
rm /var/lib/netmrg/rrd/mon_20.rrd
rrdtool restore netmrg_value1.xml /var/lib/netmrg/rrd/mon_20.rrd


The only thing this doesn't do is this: In 'natively' generated netmrg rrd's, there are 12 <rra> sections. 4 each for AVERAGE, LAST, and MAX. There are four each for the different "ppd_per_row" levels. mrtg created rrd's only have AVERAGE and MAX. when following this guide the four LAST rra sections are not added. And they are not automatically added the next time netmrg_gatherer is run. However I have not been able to find any decresed functionality or bugs from this section not being in the new rrd's.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support All times are GMT
Page 1 of 1

 



smartBlue Style © 2002 Smartor
Powered by phpBB © 2001, 2002 phpBB Group