]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
* Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB
authorkkalev <kkalev>
Wed, 8 Dec 2004 15:10:42 +0000 (15:10 +0000)
committerkkalev <kkalev>
Wed, 8 Dec 2004 15:10:42 +0000 (15:10 +0000)
* Add a configuration directive general_sessionclear_bin

Changelog
bin/snmp_clearsession [new file with mode: 0755]
conf/admin.conf

index 782a73a7687249d4961dfaf214341ada61854fd9..0f4c61cb6ece0e98107256323e2e581340febbfc 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,8 @@
+Ver 1.78:
+* Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB
+* Add a configuration directive general_sessionclear_bin
+* Add a session disconnect button in the 'clear open sessions' page
+* Also clear sessions from the sql extra servers in the 'clear open sessions' page
 Ver 1.75:
 * A LOT of security related fixes. Now dialupadmin should hopefully be secure enough to
   be accessed by normal users (not administrators).
diff --git a/bin/snmp_clearsession b/bin/snmp_clearsession
new file mode 100755 (executable)
index 0000000..8e22ea1
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+$SNMPGET="/usr/local/bin/snmpget";
+$SNMPSET="/usr/local/bin/snmpset";
+$host=shift;
+$comm=shift || 'public';
+$sessionid=shift;
+$username=shift;
+
+die "Could not find snmpwalk binary. Please make sure that the \$SNMPGET variable points to the right location\n" if (! -x $SNMPGET);
+die "Could not find snmpset binary. Please make sure that the \$SNMPSET variable points to the right location\n" if (! -x $SNMPSET);
+die "Usage: snmp_clearsession \$host \$community \$sessionid \$username\n" if ($username eq '');
+
+if ($sessionid ne '' && $username ne ''){
+       $walk =`$SNMPGET -v2c -c $comm $host .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.2.$sessionid`;
+       unless ($walk =~ /^$/){
+               if ($walk =~ /$username/){
+                       print "FOUND: $username\n";
+       `$SNMPSET -v2c -c $comm $host .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.5.$sessionid i 1`;
+               }
+       }
+}
index 241a364ac155fdf9c390a3dd3a5b494821e434aa..f3535dfaf80540c7ce743fddf8301d52910d3a47 100644 (file)
@@ -102,6 +102,11 @@ general_finger_type: snmp
 #
 general_nas_type: cisco
 general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger
+#
+# Used by the 'Disconnect User' button in the Clear Open Sessions page
+# Uses the Cisco AAA Session MIB
+#
+general_sessionclear_bin: %{general_base_dir}/bin/snmp_clearsession
 general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient
 #
 # this information is used from the server check page