Fwd: checkrad patch to support Juniper's BRAS
Hi, As bugs.freeradius.org is not working, I'm posting it here: I would like to submit a new version of this Patch, which uses snmpget instead of snmpwalk (to increase performance). It also fixes a problem with checkrad complaining about lack of $ in the "out" variable: +++ C:/Users/brgufr1/Downloads/checkrad.pl.in.txt Tue Nov 13 20:00:06 2012 @@ -24,7 +24,7 @@ # digitro_rusers 1.1 Author: accdias@sst.com.br # cyclades_snmp 1.0 Author: accdias@sst.com.br # usrhiper_snmp 1.0 Author: igor@ipass.net -# juniper_e_snmp 1.0 Author: guilhermefranco@gmail.com +# juniper_e_snmp 1.1 Author: guilhermefranco@gmail.com # multitech_snmp 1.0 Author: ehonzay@willmar.com # netserver_telnet 1.0 Author: mts@interplanet.es # versanet_snmp 1.0 Author: support@versanetcomm.com @@ -467,19 +467,24 @@ } # -# Check the subscriber name on a Juniper JunosE E-Series BRAS (ERX, E120, E320 ) +# Check the subscriber name on a Juniper JunosE E-Series BRAS (ERX, E120, E320). Requires "radius acct-session-id-format decimal" configuration in the BRAS. # # Author: Guilherme Franco <guilhermefranco@gmail.com> # sub juniper_e_snmp { + #receives acct_session + my $temp = $ARGV[4]; + #removes the leading 0s + my $clean_temp = int $temp; -out=snmpwalk($ARGV[1],$cmmty_string,".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2"); + $out=snmpget($ARGV[1], $cmmty_string, ".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2.$clean_temp"); if($out=~/\"$ARGV[3]\"/){ return 1; }else{ return 0; } + } # Thank you. Regards, Guilherme de Oliveira Franco guilhermefranco@gmail.com On Wed, Jun 13, 2012 at 8:30 PM, Guilherme Franco <guilhermefranco@gmail.com
wrote:
Hello,
I would like to submit a patch to checkrad (freeradius-server-2.1.12), adding support for Juniper's E-Series BRAS (ERX, E120, E320).
It adds the possibility to query the subscriber's username using SNMP. If the subscriber is found, it returns 1 "Returning 1 (double detected)", else, returns 0 "Returning 0 (login ok)".
On clients.conf, the nastype should be set to juniper.
--- C:/Users/brgufr1/Downloads/freeradius-server-2.1.12/freeradius-server-2.1.12/src/main/ checkrad.pl.in Fri Sep 30 11:12:07 2011 +++ C:/Users/brgufr1/Desktop/checkrad Wed Jun 13 18:49:32 2012 @@ -24,6 +24,7 @@ # digitro_rusers 1.1 Author: accdias@sst.com.br # cyclades_snmp 1.0 Author: accdias@sst.com.br # usrhiper_snmp 1.0 Author: igor@ipass.net +# juniper_e_snmp 1.0 Author: guilhermefranco@gmail.com # multitech_snmp 1.0 Author: ehonzay@willmar.com # netserver_telnet 1.0 Author: mts@interplanet.es # versanet_snmp 1.0 Author: support@versanetcomm.com @@ -466,6 +467,21 @@ }
# +# Check the subscriber name on a Juniper JunosE E-Series BRAS ( ERX, E120, E320 ) +# +# Author: Guilherme Franco <guilhermefranco@gmail.com> +# +sub juniper_e_snmp { + + $out=snmpwalk($ARGV[1],$cmmty_string,".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2"); + if($out=~/\"$ARGV[3]\"/){ + return 1; + }else{ + return 0; + } +} + +# # Check a MultiTech CommPlete Server ( CC9600 & CC2400 ) # # Author: Eric Honzay of Bennett Office Products < ehonzay@willmar.com> @@ -1434,6 +1450,8 @@ $ret = &cisco_snmp; } elsif ($ARGV[0] eq 'cvx') { $ret = &cvx_snmp; +} elsif ($ARGV[0] eq 'juniper') { + $ret = &juniper_e_snmp; } elsif ($ARGV[0] eq 'multitech') { $ret = &multitech_snmp; } elsif ($ARGV[0] eq 'computone') {
Regards,
Guilherme de Oliveira Franco guilhermefranco@gmail.com
Sorry, I forgot to point the source version (2.2.0): --- C:/Users/brgufr1/Downloads/freeradius-server-2.2.0/ freeradius-server-2.2.20/src/main/checkrad.pl.in Thanks Atenciosamente, Guilherme de Oliveira Franco guilhermefranco@gmail.com On Tue, Nov 13, 2012 at 8:35 PM, Guilherme Franco <guilhermefranco@gmail.com
wrote:
Hi,
As bugs.freeradius.org is not working, I'm posting it here:
I would like to submit a new version of this Patch, which uses snmpget instead of snmpwalk (to increase performance). It also fixes a problem with checkrad complaining about lack of $ in the "out" variable:
+++ C:/Users/brgufr1/Downloads/checkrad.pl.in.txt Tue Nov 13 20:00:06 2012 @@ -24,7 +24,7 @@ # digitro_rusers 1.1 Author: accdias@sst.com.br # cyclades_snmp 1.0 Author: accdias@sst.com.br # usrhiper_snmp 1.0 Author: igor@ipass.net -# juniper_e_snmp 1.0 Author: guilhermefranco@gmail.com +# juniper_e_snmp 1.1 Author: guilhermefranco@gmail.com # multitech_snmp 1.0 Author: ehonzay@willmar.com # netserver_telnet 1.0 Author: mts@interplanet.es # versanet_snmp 1.0 Author: support@versanetcomm.com @@ -467,19 +467,24 @@ }
# -# Check the subscriber name on a Juniper JunosE E-Series BRAS (ERX, E120, E320 ) +# Check the subscriber name on a Juniper JunosE E-Series BRAS (ERX, E120, E320). Requires "radius acct-session-id-format decimal" configuration in the BRAS. # # Author: Guilherme Franco <guilhermefranco@gmail.com> # sub juniper_e_snmp {
+ #receives acct_session + my $temp = $ARGV[4]; + #removes the leading 0s + my $clean_temp = int $temp;
-out=snmpwalk($ARGV[1],$cmmty_string,".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2"); + $out=snmpget($ARGV[1], $cmmty_string, ".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2.$clean_temp"); if($out=~/\"$ARGV[3]\"/){ return 1; }else{ return 0; } + }
#
Thank you.
Regards,
Guilherme de Oliveira Franco guilhermefranco@gmail.com
On Wed, Jun 13, 2012 at 8:30 PM, Guilherme Franco < guilhermefranco@gmail.com> wrote:
Hello,
I would like to submit a patch to checkrad (freeradius-server-2.1.12), adding support for Juniper's E-Series BRAS (ERX, E120, E320).
It adds the possibility to query the subscriber's username using SNMP. If the subscriber is found, it returns 1 "Returning 1 (double detected)", else, returns 0 "Returning 0 (login ok)".
On clients.conf, the nastype should be set to juniper.
--- C:/Users/brgufr1/Downloads/freeradius-server-2.1.12/freeradius-server-2.1.12/src/main/ checkrad.pl.in Fri Sep 30 11:12:07 2011 +++ C:/Users/brgufr1/Desktop/checkrad Wed Jun 13 18:49:32 2012 @@ -24,6 +24,7 @@ # digitro_rusers 1.1 Author: accdias@sst.com.br # cyclades_snmp 1.0 Author: accdias@sst.com.br # usrhiper_snmp 1.0 Author: igor@ipass.net +# juniper_e_snmp 1.0 Author: guilhermefranco@gmail.com # multitech_snmp 1.0 Author: ehonzay@willmar.com # netserver_telnet 1.0 Author: mts@interplanet.es # versanet_snmp 1.0 Author: support@versanetcomm.com @@ -466,6 +467,21 @@ }
# +# Check the subscriber name on a Juniper JunosE E-Series BRAS ( ERX, E120, E320 ) +# +# Author: Guilherme Franco <guilhermefranco@gmail.com> +# +sub juniper_e_snmp { + +
$out=snmpwalk($ARGV[1],$cmmty_string,".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2"); + if($out=~/\"$ARGV[3]\"/){ + return 1; + }else{ + return 0; + } +} + +# # Check a MultiTech CommPlete Server ( CC9600 & CC2400 ) # # Author: Eric Honzay of Bennett Office Products < ehonzay@willmar.com> @@ -1434,6 +1450,8 @@ $ret = &cisco_snmp; } elsif ($ARGV[0] eq 'cvx') { $ret = &cvx_snmp; +} elsif ($ARGV[0] eq 'juniper') { + $ret = &juniper_e_snmp; } elsif ($ARGV[0] eq 'multitech') { $ret = &multitech_snmp; } elsif ($ARGV[0] eq 'computone') {
Regards,
Guilherme de Oliveira Franco guilhermefranco@gmail.com
On 14 Nov 2012, at 02:26, Guilherme Franco <guilhermefranco@gmail.com> wrote:
Sorry,
I forgot to point the source version (2.2.0):
Can you just post it on github as a pull request? that's where bugs.freeradius.org is meant to direct to, something's just messed up witht he DNS record.
On 14 Nov 2012, at 13:14, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On 14 Nov 2012, at 02:26, Guilherme Franco <guilhermefranco@gmail.com> wrote:
Sorry,
I forgot to point the source version (2.2.0):
Can you just post it on github as a pull request? that's where bugs.freeradius.org is meant to direct to, something's just messed up witht he DNS record.
The bugs.freeradius.org redirect is now fixed. -Arran
participants (2)
-
Arran Cudbard-Bell -
Guilherme Franco