Sorry,<div><br></div><div>I forgot to point the source version (2.2.0):</div><div><br></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">--- C:/Users/brgufr1/Downloads/</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">freeradius-server-2.2.0/</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">freeradius-server-2.2.20/src/</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">main/</span><a href="http://checkrad.pl.in/" target="_blank" style="font-family:arial,sans-serif;font-size:13px">checkrad.pl.in</a><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
</div><div><br></div><div>Thanks</div><div class="gmail_extra"><br clear="all"><br>Atenciosamente,<br><br>Guilherme de Oliveira Franco<br><a href="mailto:guilhermefranco@gmail.com">guilhermefranco@gmail.com</a><br>
<br><br><div class="gmail_quote">On Tue, Nov 13, 2012 at 8:35 PM, Guilherme Franco <span dir="ltr"><<a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">Hi,<br><div class="gmail_quote"><div><br></div><div>As <a href="http://bugs.freeradius.org" target="_blank">bugs.freeradius.org</a> is not working, I'm posting it here:</div><div><br>
</div><div>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:</div>



<div><br></div><div><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">+++ C:/Users/brgufr1/Downloads/checkrad.pl.in.txt<span style="white-space:pre-wrap">     </span>Tue Nov 13 20:00:06 2012</div>
<div class="gmail_extra">@@ -24,7 +24,7 @@</div><div><div class="gmail_extra"> #<span style="white-space:pre-wrap">         </span>digitro_rusers<span style="white-space:pre-wrap">  </span> 1.1<span style="white-space:pre-wrap">    </span>Author: <a href="mailto:accdias@sst.com.br" target="_blank">accdias@sst.com.br</a></div>


<div class="gmail_extra"> #<span style="white-space:pre-wrap">          </span>cyclades_snmp<span style="white-space:pre-wrap">   </span> 1.0<span style="white-space:pre-wrap">    </span>Author: <a href="mailto:accdias@sst.com.br" target="_blank">accdias@sst.com.br</a></div>


<div class="gmail_extra"> #<span style="white-space:pre-wrap">          </span>usrhiper_snmp    1.0    Author: <a href="mailto:igor@ipass.net" target="_blank">igor@ipass.net</a></div></div><div class="gmail_extra">-#<span style="white-space:pre-wrap">           </span>juniper_e_snmp   1.0    Author: <a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a></div>


<div class="gmail_extra">+#<span style="white-space:pre-wrap">          </span>juniper_e_snmp   1.1    Author: <a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a></div><div><div class="gmail_extra">

 #<span style="white-space:pre-wrap">           </span>multitech_snmp   1.0    Author: <a href="mailto:ehonzay@willmar.com" target="_blank">ehonzay@willmar.com</a></div>
<div class="gmail_extra"> #<span style="white-space:pre-wrap">          </span>netserver_telnet 1.0<span style="white-space:pre-wrap">    </span>Author: <a href="mailto:mts@interplanet.es" target="_blank">mts@interplanet.es</a></div>

<div class="gmail_extra">
 #<span style="white-space:pre-wrap">           </span>versanet_snmp    1.0    Author: <a href="mailto:support@versanetcomm.com" target="_blank">support@versanetcomm.com</a></div></div><div class="gmail_extra">@@ -467,19 +467,24 @@</div>

<div><div class="gmail_extra">
 }</div><div class="gmail_extra"> </div><div class="gmail_extra"> #</div><div class="gmail_extra">-#       Check the subscriber name on a Juniper JunosE E-Series BRAS (ERX, E120, E320 )</div></div><div class="gmail_extra">

+#       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.</div>
<div class="gmail_extra"> #</div><div class="gmail_extra"> #       Author: Guilherme Franco <<a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a>></div><div class="gmail_extra"> #</div>

<div class="gmail_extra">
 sub juniper_e_snmp {</div><div class="gmail_extra"> </div><div class="gmail_extra">+<span style="white-space:pre-wrap">                            </span>                #receives acct_session</div><div class="gmail_extra">+                my $temp = $ARGV[4];</div>


<div class="gmail_extra">+                #removes the leading 0s</div><div class="gmail_extra">+                my $clean_temp = int $temp;</div><div><div class="gmail_extra"> </div><div class="gmail_extra">-out=snmpwalk($ARGV[1],$cmmty_string,".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2");</div>


</div><div class="gmail_extra">+                $out=snmpget($ARGV[1], $cmmty_string, ".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2.$clean_temp");</div><div class="gmail_extra">                 if($out=~/\"$ARGV[3]\"/){</div>


<div class="gmail_extra">                         return 1;</div><div class="gmail_extra">                 }else{</div><div class="gmail_extra">                         return 0;</div><div class="gmail_extra">                 }</div>


<div class="gmail_extra">+</div><div class="gmail_extra"> }</div><div class="gmail_extra"> </div><div class="gmail_extra"> #</div><div><br></div></div><div class="gmail_extra"><br></div></div><div class="gmail_extra">Thank you.<div>

<br>
<br>Regards,<br><br>Guilherme de Oliveira Franco<br><a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a><br>
<br><br></div><div><div><div class="gmail_quote">On Wed, Jun 13, 2012 at 8:30 PM, Guilherme Franco <span dir="ltr"><<a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Hello,<br>
<br>
I would like to submit a patch to checkrad (freeradius-server-2.1.12),<br>
adding support for Juniper's E-Series BRAS (ERX, E120, E320).<br>
<br>
It adds the possibility to query the subscriber's username using SNMP.<br>
If the subscriber is found, it returns 1 "Returning 1 (double<br>
detected)", else, returns 0 "Returning 0 (login ok)".<br>
<br>
On clients.conf, the nastype should be set to juniper.<br>
<br>
--- C:/Users/brgufr1/Downloads/freeradius-server-2.1.12/freeradius-server-2.1.12/src/main/<a href="http://checkrad.pl.in" target="_blank">checkrad.pl.in</a><br>
       Fri<br>
Sep 30 11:12:07 2011<br>
+++ C:/Users/brgufr1/Desktop/checkrad   Wed Jun 13 18:49:32 2012<br>
@@ -24,6 +24,7 @@<br>
 #              digitro_rusers   1.1    Author: <a href="mailto:accdias@sst.com.br" target="_blank">accdias@sst.com.br</a><br>
 #              cyclades_snmp    1.0    Author: <a href="mailto:accdias@sst.com.br" target="_blank">accdias@sst.com.br</a><br>
 #              usrhiper_snmp    1.0    Author: <a href="mailto:igor@ipass.net" target="_blank">igor@ipass.net</a><br>
+#              juniper_e_snmp   1.0    Author: <a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a><br>
 #              multitech_snmp   1.0    Author: <a href="mailto:ehonzay@willmar.com" target="_blank">ehonzay@willmar.com</a><br>
 #              netserver_telnet 1.0    Author: <a href="mailto:mts@interplanet.es" target="_blank">mts@interplanet.es</a><br>
 #              versanet_snmp    1.0    Author: <a href="mailto:support@versanetcomm.com" target="_blank">support@versanetcomm.com</a><br>
@@ -466,6 +467,21 @@<br>
 }<br>
<br>
 #<br>
+#       Check the subscriber name on a Juniper JunosE E-Series BRAS (<br>
ERX, E120, E320 )<br>
+#<br>
+#       Author: Guilherme Franco <<a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a>><br>
+#<br>
+sub juniper_e_snmp {<br>
+<br>
+<br>
$out=snmpwalk($ARGV[1],$cmmty_string,".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2");<br>
+                if($out=~/\"$ARGV[3]\"/){<br>
+                        return 1;<br>
+                }else{<br>
+                        return 0;<br>
+                }<br>
+}<br>
+<br>
+#<br>
 #       Check a MultiTech CommPlete Server ( CC9600 & CC2400 )<br>
 #<br>
 #       Author: Eric Honzay of Bennett Office Products <<a href="mailto:ehonzay@willmar.com" target="_blank">ehonzay@willmar.com</a>><br>
@@ -1434,6 +1450,8 @@<br>
       $ret = &cisco_snmp;<br>
 } elsif ($ARGV[0] eq 'cvx') {<br>
       $ret = &cvx_snmp;<br>
+} elsif ($ARGV[0] eq 'juniper') {<br>
+        $ret = &juniper_e_snmp;<br>
 } elsif ($ARGV[0] eq 'multitech') {<br>
       $ret = &multitech_snmp;<br>
 } elsif ($ARGV[0] eq 'computone') {<br>
<br>
Regards,<br>
<br>
Guilherme de Oliveira Franco<br>
<a href="mailto:guilhermefranco@gmail.com" target="_blank">guilhermefranco@gmail.com</a><br>
</blockquote></div><br></div></div></div></div>
</div><br>
</div></div></blockquote></div><br></div>