Hello,
Could someone include this patch for me ? or tell me the reason why this is not applicable ?
TIA,
--
DouRiX
Original Message
Subject: checkrad.pl.in patch for freeradius-0.9.0 ...
Date: Thu, 07 Aug 2003 17:22:26 +0300
From: Do-Risika RAFIEFERANTSIARONJY [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Organization: Simicro Internet
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Hello,
I am a freeradius patton user. I already submitted this patch several months ago, but I've noticed that it's not applied yet, so I *re-submit* (as you said Don't get discouraged :).
It's a patch to the src/main/checkrad.pl.in file, for the current version 0.9.0.
It's due to _MIB_structure_changes_ on new patton RAS (2960 boxes, you could contact [EMAIL PROTECTED] to confirm). I've added a _new_function_ for patton 2960 (thus a new ras type 'patton2960'), because as Alan advised, modifying directly the patton_snmp() sub could break compatibility with old hardwares (patton 28xx).
I have also added _community_string_lookup_ in naspasswd file, as users could use a non 'public' community name, and I think it'll be more convenient. Though, it should always work with 'public' community name.
Here is my previous exchange with Alan about this issue :
Alan DeKok wrote:
Do-Risika RAFIEFERANTSIARONJY [EMAIL PROTECTED] wrote:
You've deleted the support for older Patton hardware, and replace it
with support for the 2960. Why?
because as i know, they don't sell it anymore.
Do people still use it?
Probably.
It won't be if I can add a new function and a new nas type, for example
patton2960. Is there a problem if I do that ? if not, I'll to submit the
new patch,
Sounds good to me.
I wish you would apply, I'm always obliged to patch my source before each upgrade.
Please notify if/when it'll be applied or not,
Thanks in advance,
_here_is_the_patch_ :
--- checkrad.pl.in.orig.freeradius-0.9.0Thu Aug 7 16:07:05 2003
+++ checkrad.pl.in.new.freeradius-0.9.0 Thu Aug 7 16:13:38 2003
@@ -31,6 +31,7 @@
# cisco_l2tp 1.14 Author: [EMAIL PROTECTED]
# mikrotik_telnet 1.0Author: Evren Yurtesen [EMAIL PROTECTED]
# redback_telnet Author: Eduardo Roldan
+# patton2960_snmp 1.0Author: [EMAIL PROTECTED]
#
# Config: $debug is the file you want to put debug messages in
# $snmpget is the location of your ``snmpget'' program
@@ -850,6 +851,54 @@
}
#
+# Check a Patton 2960 via SNMP
+# Version: 1.0, based on patton_snmp(),
+# new patton model with new MIBS structures
+# Author: DouRiX [EMAIL PROTECTED]
+#
+sub patton2960_snmp {
+ my($oid);
+
+ # Look up community string in naspasswd file.
+ my ($login, $pass) = naspasswd($ARGV[1], 1);
+ if ($login eq '') {
+ $pass = 'public';
+ }
+ elsif ($login ne 'SNMP') {
+ if ($debug) {
+ print LOG
+ Error: Need SNMP community string for $ARGV[1]\n;
+ }
+ return 2;
+ }
+
+ # formule : sessionid = auRadiusRunningId . callid
+ my $auRadiusRunningId = snmpget($ARGV[1], $pass, .1.3.6.1.4.1.1768.3.32);
+ $auRadiusRunningId =~ s/\s//g;
+
+ my $callid = $ARGV[4];
+ $callid =~ s/^$auRadiusRunningId//;
+
+ if ($callid eq $ARGV[4]) {
+ # error ...
+ print LOGError: sessionId differs to auRadiusRunningId . callId !!!\n if $debug;
+ return 2;
+ }
+
+ $oid = '.1.3.6.1.4.1.1768.5.100.1.56.' . hex $callid;
+
+ #
+ # Check if the session still active
+ #
+ if (snmpget($ARGV[1], $pass, $oid) == 0) {
+ print LOG Session $ARGV[4] still active on NAS .
+$ARGV[1], port $ARGV[2], for user $ARGV[3].\n if ($debug);
+ return 1;
+ }
+ 0;
+}
+
+#
# Check a Digitro BXS via rusers
#
# Version: 1.1
@@ -1332,6 +1381,8 @@
$ret = cyclades_snmp;
} elsif ($ARGV[0] eq 'patton') {
$ret = patton_snmp;
+} elsif ($ARGV[0] eq 'patton2960') {
+ $ret = patton2960_snmp;
} elsif ($ARGV[0] eq 'digitro') {
$ret = digitro_rusers;
} elsif ($ARGV[0] eq 'usrhiper') {
--
DouRiX
[Good men must not obey the laws too well. -- Ralph Waldo Emerson]
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html