Page 1 of 1

MRTG dynamic PPPoE or PPTP interface

Posted: Sun Nov 16, 2014 2:18 pm
by markom
Hello,
My Mikrotik is PPoE and PPtP concentrator. Is there any way to MRTG pppoe interface constantly.
The problem is, when some customer restart router (client side) PPPoE get different OID and MRTG stop working.

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Thu Feb 19, 2015 11:21 am
by kgninfos
i have been also asking the same question
and seems mikrotik is not going to answer it

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Thu Oct 08, 2015 10:16 am
by magnavox
Helo, a solution is described in this post http://forum.mikrotik.com/viewtopic.php ... &t=43#p188

We are some issue:

- interface-number (or OID) change every user connection
- using cfgmaker whit option
-ifref=nr -ifdescr=name
MRTG work fine and create graphs... but after user reconnection, MRTG loose history because MRTG use interface-name in .html e .log file... and don't match...
- using cfgmaker whit option
-ifref=name, -ifdescr=name
MRTG/SNMP seem not able to read data; I suppose the problem is name of PPPoE interfaces, like <pppoe-user0002>...


A solution can be modifiy cfgmaker (when using option -ifref=nr ifdescr=name) to use interface-name (like <pppoe-user0002>) as namefile of .html and .log file where MRTG store data and interface-number for target (readed by SNMP). So after user disconnect/connect MRTG will store data always in a file named like <pppoe-user0002>.log
cfgmaker -ifref=nr -ifdescr=name
need to retur for target line a code like:
Target[router_<pppoe-user0002>]: 15744109:public@router:
instead of:
Target[router_15744109]: 15744109:public@router:
Someone can help me? :)

Sorry for m poor english...

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sat Jul 23, 2016 7:32 pm
by soamz
Anu succeess yet ?

I need it asap!!!

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sat Jul 23, 2016 7:38 pm
by pe1chl
Should not be a problem with the proper MRTG configuration!
Is not a MikroTik issue, it is about knowing how to configure and use MRTG.
I have used MRTG with many different devices and this issue always occurs.  You need to find and use the proper interface reference.

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sat Jul 23, 2016 7:42 pm
by soamz
Should not be a problem with the proper MRTG configuration!
Is not a MikroTik issue, it is about knowing how to configure and use MRTG.
I have used MRTG with many different devices and this issue always occurs.  You need to find and use the proper interface reference.
Have you done it ?
can you share some images ?
How will MRTG know you connected 3 new customers today and you want to see their graph as well ?

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sat Jul 23, 2016 11:38 pm
by pe1chl
I have not done this for that particular application but I faced the same issue in other cases.
Of course you need to write a program/script that adds MRTG config for every new interface (customer in your case).
But that is quite easy as it is only the addition of a fixed section with simple parameter substitution (the name).

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sun Jul 24, 2016 1:49 am
by soamz
I have not done this for that particular application but I faced the same issue in other cases.
Of course you need to write a program/script that adds MRTG config for every new interface (customer in your case).
But that is quite easy as it is only the addition of a fixed section with simple parameter substitution (the name).
Your email address please. 

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue Aug 30, 2016 8:10 am
by lambert
I'm working on this today....

Target[username]: \<pppoe-username\@udomain.net>:community@router.domain.net

seems to work.

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue Aug 30, 2016 12:15 pm
by magnavox
I'm working on this today....

Target[username]: \<pppoe-username\@udomain.net>:community@router.domain.net

seems to work.
Are you sure?
Can you post a real example?

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue Aug 30, 2016 1:08 pm
by soamz
Logout and login again. And see.
I doubt.

And screenshots upload please.

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue Aug 30, 2016 1:20 pm
by magnavox
Seems to work:

#Target[username]: \<pppoe-username\@udomain.net>:community@router.domain.net
Target[t000287]: \<pppoe-t000287\@xxxxxx.yy>:community@xxx.yyy.zzz.kkk::5::2:2

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue Aug 30, 2016 1:24 pm
by soamz
screenshots please.

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue Aug 30, 2016 1:29 pm
by magnavox
screenshots please.
Sorry, I just tried for test and deleted.

I m using other way to generate .cfg because customers can login into multiple PPPoE server,
so a script perform a query from RADIUS and generate .cfg file for "current connected" users for each NAS.

If you have only a NAS or customers are locked to a NAS, use this.
Try, its work.

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue Aug 30, 2016 8:29 pm
by docmarius
In mrtg config, you can use interface names instead of interface numbers.
e.g. instead of something like
Target[host_2]: 2:public@192.168.1.1:
one could use the interface name prefixed by #:
Target[host_2]: #eth0:public@192.168.1.1:

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Fri Apr 13, 2018 1:45 pm
by kgninfos
can anyone post a sample mrtg config for the PPPoE or PPTP interface

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sat Apr 14, 2018 3:57 pm
by docmarius
Adapt fields to yout needs... Interface name (ppoe_interface in the example), IP's(interface is assumed on 192.168.1.1), speeds.
localhost_11 is just a label and needs to be unique in the config.
Target[localhost_11]: #pppoe_interface:public@192.168.1.1:
SetEnv[localhost_11]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="PPPoE"
MaxBytes[localhost_11]: 125000000
Title[localhost_11]: Traffic Analysis for PPPoE Interface
PageTop[localhost_11]: <h1>Traffic Analysis for PPPoE Interface</h1>
		<div id="sysdetails">
			<table>
				<tr>
					<td>System:</td>
					<td>Router</td>
				</tr>
				<tr>
					<td>Maintainer:</td>
					<td>Admin &lt;admin@localhost&gt;</td>
				</tr>
				<tr>
					<td>Description:</td>
					<td>PPPoE Interface </td>
				</tr>
				<tr>
					<td>ifType:</td>
					<td>pppoe</td>
				</tr>
				<tr>
					<td>ifName:</td>
					<td>pppoe_interface</td>
				</tr>
				<tr>
					<td>Max Speed:</td>
					<td>125.0 Mbytes/s</td>
				</tr>
				<tr>
					<td>Ip:</td>
					<td>192.168.1.1</td>
				</tr>
			</table>
		</div>

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sat Apr 14, 2018 4:10 pm
by kgninfos
ok i was able to get the value
but is a non existent interface is there in config it takes a long time before exiting the check
any solution for that??

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sat Apr 14, 2018 9:25 pm
by docmarius
If you use the interface number, that's faster. But then this number changes if the interface goes down and up again, depending on the system.
If it stays the same, you can use something like 3:public@192.168.1.1: (you need to find it via a snmp walk...)

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sun Apr 15, 2018 6:49 am
by kgninfos
What i want is to graph all available interface at once including dynamic one by name.
Some wildcard kind of thing like #ether-*:public@192.168.1.1: is it possible ??

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Sun Apr 15, 2018 10:56 am
by pe1chl
It is not useful to graph dynamic interfaces this way because they will be in use by different customers at different times.
You will need to do something that makes it possible to identify them, maybe rename the interface in the up-script (don't know if that is possible)

Re: MRTG dynamic PPPoE or PPTP interface

Posted: Tue May 29, 2018 3:36 pm
by karlos1973
cfgmaker --ifref=name --ifdesc=name --use-16bit '--if-filter=$if_is_dialup' --noreversedns --snmp-options :::::2 --global "WorkDir: /var/www/html" --global "Options[_]: growright, bits " public@192.168.0.1 --output=/root/mrtg.cfg
env LANG=C /usr/bin/mrtg /root/mrtg.cfg
indexmaker /root/mrtg.cfg --output=/var/www/html/index.html


This is my code for dinamic PPPoE.