bpft4-cvs Mailing List for BPF traffic daemon/collector
Status: Beta
Brought to you by:
stas_degteff
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Stas D. <sta...@us...> - 2006-06-29 14:43:35
|
Update of /cvsroot/bpft4/dailytraffic In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4920 Modified Files: 900.traffic Log Message: add comments and port 25 to interested ports Index: 900.traffic =================================================================== RCS file: /cvsroot/bpft4/dailytraffic/900.traffic,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- 900.traffic 29 Jun 2006 14:31:16 -0000 1.13 +++ 900.traffic 29 Jun 2006 14:43:26 -0000 1.14 @@ -77,10 +77,14 @@ exit; } +# $servports: interested ports > 1023 (regexp) +# %services: services names local $servports = '(2401|4000|6666|6667|24554|60177|60179)'; local %services = ( 4000, "icq", 6666, "irc1", 6667, "irc2", 24554, "binkd", 60177, "ITN", 60179, "IFC", 53, "dns", 80, http, 21, - ftp, 20, "ftp-data", 22, ssh, 119, nntp, 2401, cvs ); + ftp, 20, "ftp-data", 22, ssh, 119, nntp, 2401, cvs, + 25, mail, + ); local %sum=(); local $all; local %detsum=(); |
From: Stas D. <sta...@us...> - 2006-06-29 14:31:19
|
Update of /cvsroot/bpft4/dailytraffic In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32037 Modified Files: 900.traffic Log Message: Print or don't print full traffic table Index: 900.traffic =================================================================== RCS file: /cvsroot/bpft4/dailytraffic/900.traffic,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- 900.traffic 29 Jun 2006 14:24:20 -0000 1.12 +++ 900.traffic 29 Jun 2006 14:31:16 -0000 1.13 @@ -6,6 +6,7 @@ # mailing traffic statistics # +$printFullTable=0; $iface = 'xl0'; ($hostname = `hostname`) =~ s/\n//g; $toaddr = 'root\@$hostname'; @@ -157,15 +158,17 @@ } printf OUT "%-38s%11d (%6dM)\n", "All", $all, int($all/1024/1024+0.5); -print OUT "\n Full traffic table (incoming):\n"; -if(open(II,$tempfile)){ - while( <II> ){ - print OUT $_; +if( $printFullTable >0 ) { + print OUT "\n Full traffic table (incoming):\n"; + if(open(II,$tempfile)){ + while( <II> ){ + print OUT $_; + } + close(II); + print OUT "\n"; + }else{ + print OUT " Cannot open $tempfile!\n" } - close(II); - print OUT "\n"; -}else{ - print OUT " Cannot open $tempfile!\n" } close OUT; |
From: Stas D. <sta...@us...> - 2006-06-29 14:24:26
|
Update of /cvsroot/bpft4/dailytraffic In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29090 Modified Files: 900.traffic Log Message: Add summary month Index: 900.traffic =================================================================== RCS file: /cvsroot/bpft4/dailytraffic/900.traffic,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- 900.traffic 30 Dec 2003 06:36:00 -0000 1.11 +++ 900.traffic 29 Jun 2006 14:24:20 -0000 1.12 @@ -7,9 +7,13 @@ # $iface = 'xl0'; -$myaddr='192.168.254.1'; -$out_to = '|/usr/sbin/sendmail root'; -#$out_to = ">aaa"; +($hostname = `hostname`) =~ s/\n//g; +$toaddr = 'root\@$hostname'; +$out_to = '|/usr/sbin/sendmail $toaddr'; +$summaryfile = "/var/log/trafficsumm"; + +$myaddr=`ifconfig $iface | grep "inet " | cut -d " " -f 2`; +chomp $myaddr; ($tempfile = $0) =~ s%.*/%%; $tempfile = "/tmp/$tempfile.tmp"; @@ -27,7 +31,6 @@ # Mail header # -($hostname = `hostname`) =~ s/\n//g; #chomp($daydate = `date -v-1d "+%a, %d %b %Y"`); my @monthnames = qw/ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec /; @@ -49,7 +52,7 @@ } print OUT <<HDR; -To: <root\@$hostname> +To: <$toaddr> Date: $date From: "Traffic daily script" <root\@$hostname> Subject: IP statistics @@ -168,6 +171,12 @@ close OUT; unlink $tempfile; +if( open S, ">>$summaryfile" ) { + print S "$year-",$mon+1,"-$mday,",$trafficsum{"world"},",", + $trafficsum{"city"},",",$trafficsum{"local"},"\n"; + close S; +} + exit; sub testtraffic(){ |