Community discussions

MikroTik App
 
markom
Member Candidate
Member Candidate
Topic Author
Posts: 112
Joined: Thu Dec 17, 2009 10:42 pm

MRTG dynamic PPPoE or PPTP interface

Sun Nov 16, 2014 2:18 pm

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.
 
kgninfos
Member
Member
Posts: 387
Joined: Thu Jun 21, 2012 7:34 pm
Location: Earth
Contact:

Re: MRTG dynamic PPPoE or PPTP interface

Thu Feb 19, 2015 11:21 am

i have been also asking the same question
and seems mikrotik is not going to answer it
 
magnavox
Member
Member
Posts: 357
Joined: Thu Jun 14, 2007 1:03 pm

Re: MRTG dynamic PPPoE or PPTP interface

Thu Oct 08, 2015 10:16 am

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...
 
soamz
Member
Member
Posts: 430
Joined: Thu Mar 19, 2015 7:19 am

Re: MRTG dynamic PPPoE or PPTP interface

Sat Jul 23, 2016 7:32 pm

Anu succeess yet ?

I need it asap!!!
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: MRTG dynamic PPPoE or PPTP interface

Sat Jul 23, 2016 7:38 pm

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.
 
soamz
Member
Member
Posts: 430
Joined: Thu Mar 19, 2015 7:19 am

Re: MRTG dynamic PPPoE or PPTP interface

Sat Jul 23, 2016 7:42 pm

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 ?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: MRTG dynamic PPPoE or PPTP interface

Sat Jul 23, 2016 11:38 pm

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).
 
soamz
Member
Member
Posts: 430
Joined: Thu Mar 19, 2015 7:19 am

Re: MRTG dynamic PPPoE or PPTP interface

Sun Jul 24, 2016 1:49 am

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. 
 
lambert
Long time Member
Long time Member
Posts: 548
Joined: Fri Jul 23, 2010 1:09 am

Re: MRTG dynamic PPPoE or PPTP interface

Tue Aug 30, 2016 8:10 am

I'm working on this today....

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

seems to work.
 
magnavox
Member
Member
Posts: 357
Joined: Thu Jun 14, 2007 1:03 pm

Re: MRTG dynamic PPPoE or PPTP interface

Tue Aug 30, 2016 12:15 pm

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?
 
soamz
Member
Member
Posts: 430
Joined: Thu Mar 19, 2015 7:19 am

Re: MRTG dynamic PPPoE or PPTP interface

Tue Aug 30, 2016 1:08 pm

Logout and login again. And see.
I doubt.

And screenshots upload please.
 
magnavox
Member
Member
Posts: 357
Joined: Thu Jun 14, 2007 1:03 pm

Re: MRTG dynamic PPPoE or PPTP interface

Tue Aug 30, 2016 1:20 pm

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
 
soamz
Member
Member
Posts: 430
Joined: Thu Mar 19, 2015 7:19 am

Re: MRTG dynamic PPPoE or PPTP interface

Tue Aug 30, 2016 1:24 pm

screenshots please.
 
magnavox
Member
Member
Posts: 357
Joined: Thu Jun 14, 2007 1:03 pm

Re: MRTG dynamic PPPoE or PPTP interface

Tue Aug 30, 2016 1:29 pm

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.
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: MRTG dynamic PPPoE or PPTP interface

Tue Aug 30, 2016 8:29 pm

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:
 
kgninfos
Member
Member
Posts: 387
Joined: Thu Jun 21, 2012 7:34 pm
Location: Earth
Contact:

Re: MRTG dynamic PPPoE or PPTP interface

Fri Apr 13, 2018 1:45 pm

can anyone post a sample mrtg config for the PPPoE or PPTP interface
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: MRTG dynamic PPPoE or PPTP interface

Sat Apr 14, 2018 3:57 pm

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>
 
kgninfos
Member
Member
Posts: 387
Joined: Thu Jun 21, 2012 7:34 pm
Location: Earth
Contact:

Re: MRTG dynamic PPPoE or PPTP interface

Sat Apr 14, 2018 4:10 pm

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??
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: MRTG dynamic PPPoE or PPTP interface

Sat Apr 14, 2018 9:25 pm

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...)
 
kgninfos
Member
Member
Posts: 387
Joined: Thu Jun 21, 2012 7:34 pm
Location: Earth
Contact:

Re: MRTG dynamic PPPoE or PPTP interface

Sun Apr 15, 2018 6:49 am

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 ??
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: MRTG dynamic PPPoE or PPTP interface

Sun Apr 15, 2018 10:56 am

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)
 
karlos1973
just joined
Posts: 3
Joined: Sat Jun 04, 2011 12:09 pm

Re: MRTG dynamic PPPoE or PPTP interface

Tue May 29, 2018 3:36 pm

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.

Who is online

Users browsing this forum: No registered users and 83 guests