LightSquid Home Site : Ip2Name
This page last changed on июл 06, 2009 by esl.
IP2NAMEin some cases you have squid without authorization why I write this once i have folowing configuration about 80 pc, WINDOWS NT domain, squid without authorization (for some reason) i wrote special IP2NAME who ask mysql (use time and ip) and recive username plese reffer ip2name folder, for example ip2name
each ip2name contain 3 function
sample script #ESL #convert user -> ip , get user name from file #file format # #192.168.0.96 User1 #192.168.0.106 User2 #192.168.0.105 User3 # #if user not found -> return IP sub StartIp2Name() { my $ipfile = "/etc/squid/users.txt"; open (F, "<$ipfile") || die ("ERROR: Can't open $ipfile!!! \n"); while (<F>) { chomp; ($ip,$user) = split; $hIP2NAME{$ip}=$user; } close (F); } sub Ip2Name($$$) { # $Lhost,$user,$Ltimestamp my $ip=shift; my $ret; if (defined $hIP2NAME{$ip}) { $ret=$hIP2NAME{$ip}; } else { $ret=$ip; } return $ret; } sub StopIp2Name() { } #warning !!! 1; |
Document generated by Confluence on июл 07, 2009 00:15 |