/[cricket]/parse_iptraf.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /parse_iptraf.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by dpavlin, Mon May 20 17:25:52 2002 UTC revision 1.5 by dpavlin, Wed May 22 07:11:08 2002 UTC
# Line 2  Line 2 
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;
# Line 57  close(D); Line 59  close(D);
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    
# Line 67  foreach my $port (keys %hash) { Line 69  foreach my $port (keys %hash) {
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";

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.26