[ixpmanager] MRTG INTEGRATION

Barry O'Donovan barry.odonovan at inex.ie
Tue Jan 30 14:44:58 GMT 2018


Hi Muyiwa,

Marco d'Itri wrote:
>> Before now I already had MRTG running on a different server (Windows), Is
>> there any way I can copy the old MRTG.cfg file and the content of the log
>> file into IXP Manager so it just runs seamlessly?

> mrtg.cfg will be generated by IXP manager.

Exactly as Marco says - this will be generated by IXP Manager. It has to
be as it names the files and creates a directory structure so that IXP
Manager knows where to find the appropriate MRTG files.

> You can copy the logged data to the new system, but you will need to 
> figure out how to match the old and new graphs.

Yip and this is essentially what we did when we moved from the old
system to 'Grapher'. We wrote a migration script that did this but it
was easier as we knew the old and new scheme intricately.

To do this yourself - and assuming a one member / one port setup - you'd
need to copy the MRTG log/rrd file to both a physical interface location
and a member aggregate location.

Let's say you have a membera.log file which represents a members traffic
(bits/sec).

If the customer database ID for this member is 16 (for example) you'd
need to:

mkdir -p $GRAPHER_BACKEND_MRTG_WORKDIR/members/0/00016
cp membera.log
$GRAPHER_BACKEND_MRTG_WORKDIR/members/0/00016/aggregate-00016-bits.log

You'll find the customer's ID in the customer over page URL - e.g.:

https://ixp.example.com/customer/overview/id/16

If using RRD then just swap .log for .rrd.

This path comes from:

sprintf( "%x/%05d", $id % 16, $id ) where $id is 16 in this case.


Now you should also create the physical interface (actual switch port
graph). You'll find the physical interface ID by looking at the
customers interface (goto customer overview, select Ports tab, select
edit next to a port. You should have a URL like:

https://ixp.example.com/interfaces/virtual/edit/xxx

Now select the edit icon under physical interfaces to find a URL like:

https://ixp.example.com/interfaces/physical/edit/yyy/vintid/xxx

It's the yyy you want here. And with that (still with customer ID 16):


mkdir -p $GRAPHER_BACKEND_MRTG_WORKDIR/members/0/00016/ints
cp membera.log
$GRAPHER_BACKEND_MRTG_WORKDIR/members/0/00016/ints/pi00yyy-bits.log

Note the 'yyy' should be printed as printf type '%05d'.

If you have multiple ports per customer it's more complicated as you'll
need to aggregate them for the aggregate-00016-bits.log.

And similarly if you have LAGs there's another form of aggregation
required. Come back as ask!



It's a bit of work for sure but it is (a) doable and (b) scriptable.

 - Barry







More information about the ixpmanager mailing list