2 |
|
|
3 |
# based on work of Eric Wong <eric@taedium.net> |
# based on work of Eric Wong <eric@taedium.net> |
4 |
# available at http://www.taedium.net/rrd-iptraf/ [iptraf.txt] |
# available at http://www.taedium.net/rrd-iptraf/ [iptraf.txt] |
5 |
|
# |
6 |
|
# Dobrica Pavlinusic <dpavlin@rot13.org> |
7 |
|
|
8 |
use strict; |
use strict; |
9 |
use warnings; |
use warnings; |
59 |
close(LOG); |
close(LOG); |
60 |
|
|
61 |
foreach my $port (@PORTS) { |
foreach my $port (@PORTS) { |
62 |
print @{$hash{$port}}[0] || 0,"\n",@{$hash{$port}}[1] || 0,"\n"; |
print @{$hash{$port}}[0] || "U","\n",@{$hash{$port}}[1] || "U","\n"; |
63 |
delete $hash{$port}; |
delete $hash{$port}; |
64 |
} |
} |
65 |
|
|
69 |
$sum_in+=@{$hash{$port}}[0]; |
$sum_in+=@{$hash{$port}}[0]; |
70 |
$sum_out+=@{$hash{$port}}[1]; |
$sum_out+=@{$hash{$port}}[1]; |
71 |
} |
} |
72 |
|
|
73 |
|
$sum_in = "U" if ($sum_in == 0); |
74 |
|
$sum_out = "U" if ($sum_out == 0); |
75 |
print "$sum_in\n$sum_out\n"; |
print "$sum_in\n$sum_out\n"; |