From: dragon9k Date: Fri, 7 Dec 2012 17:29:01 +0000 (-0200) Subject: New checkrad version patch (Juniper) X-Git-Tag: release_2_2_1~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2960b5b68132c08079a7b589ddf89a7913b8fc7;p=thirdparty%2Ffreeradius-server.git New checkrad version patch (Juniper) I would like to submit a new version of this Patch for FR 2.20, which uses snmpget instead of snmpwalk (to increase performance). It also fixes a problem with checkrad complaining about lack of $ in the "out" variable. --- diff --git a/src/main/checkrad.pl.in b/src/main/checkrad.pl.in index 7e32014683f..72e318cb9e5 100644 --- a/src/main/checkrad.pl.in +++ b/src/main/checkrad.pl.in @@ -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,12 +467,17 @@ sub cisco_snmp { } # -# 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 # 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"); + #receives acct_session + my $temp = $ARGV[4]; + #removes the leading 0s + my $clean_temp = int $temp; + + $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{