3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
./radiusreport -l all -f /var/log/freeradius/radacct/192.168.2.2/detail-20051107
Radius Log Report for: client01
Date Login Logout Ontime Port
-----------------------------------------------------------------------------
------------------------------------------------------------------------
Radius Log Report for: client11
Date Login Logout Ontime Port
-----------------------------------------------------------------------------
------------------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Mon Nov 7 09:32:49 2005
NAS-IP-Address = 192.168.2.2
NAS-Port = 50003
NAS-Port-Type = Ethernet
User-Name = "client01"
Called-Station-Id = "00-14-69-98-F5-43"
Calling-Station-Id = "00-0F-1F-A6-ED-68"
Acct-Status-Type = Start
Acct-Authentic = RADIUS
Acct-Session-Id = "192.168.2.2 client01 03/01/93 00:38:18 00000001"
Acct-Delay-Time = 0
Client-IP-Address = 192.168.2.2
Acct-Unique-Session-Id = "420ad22d9b4e2d57"
Timestamp = 1131352369
Mon Nov 7 09:34:24 2005
NAS-IP-Address = 192.168.2.2
NAS-Port = 50003
NAS-Port-Type = Ethernet
User-Name = "client01"
Called-Station-Id = "00-14-69-98-F5-43"
Calling-Station-Id = "00-0F-1F-A6-ED-68"
Acct-Status-Type = Stop
Acct-Authentic = RADIUS
Acct-Session-Id = "192.168.2.2 client01 03/01/93 00:38:18 00000001"
Acct-Terminate-Cause = Port-Error
Acct-Input-Octets = 8587
Acct-Output-Octets = 6748
Acct-Session-Time = 95
Acct-Delay-Time = 0
Client-IP-Address = 192.168.2.2
Acct-Unique-Session-Id = "420ad22d9b4e2d57"
Timestamp = 1131352464
1
2
3
4
5
6
7
./radiusreport -l all -f /var/log/freeradius/radacct/192.168.2.2/detail-20051107
Radius Log Report for: client01
Date Login Logout Ontime Port
-----------------------------------------------------------------------------
client01/192.168.2.2 cleint01 03/01/93 003818 00000001/50003/192.168.2.2client01/192.168.2.200000001/50003/192.168.2.2client01/192.168.2.2 usw.
------------------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
my $filename = "blablablubb.txt";
unless (open (FILE, "<", $filename)) {
die "Error: couldn't read file '$filename': $!\n";
} # unless
else {
local $/ = "\n\n"; # nicht zeilen, sondern bloecke lesen (trenner ist \n\n)
while (<FILE>) { # $_ enthaelt nun jeweils einen ganzen block
chomp($_); # \n\n am ende entfernen
my ($date, @rest) = split(/\n/, $_); # aufsplitten nach \n, erste zeile $date zuweisen
my %data = ();
foreach my $line (@rest) {
my ($key, $value) = split(/\s*=\s*/, $line, 2); # an = aufsplitten in maximal 2 teile
$key =~ s/^\s+//; # leerzeichen am anfang abschneiden
$data{$key} = $value; # wenn $key mehrmals vorkommt, ueberschreibst du dir aeltere keys
} # foreach
# mach was mit $date und %data, z.B.
print "Datum: $date\n";
foreach my $key (sort keys %data) {
print "$key: $data{$key}\n";
} # foreach
print "-" x 60, "\n";
} # while
close (FILE);
} # else
3 Einträge, 1 Seite |