Commit 99c27f8a authored by schlick's avatar schlick

udp stuff added

parent 8208364f
This diff is collapsed.
......@@ -11,7 +11,7 @@
#
# - connection tracking....
#
# $Id: rrd_shorewallstats.pl,v 1.5 2006/08/17 22:11:43 schlick Exp $
# $Id: rrd_shorewallstats.pl,v 1.6 2006/08/17 23:58:49 schlick Exp $
#############################################################################
use strict;
use RRDs;
......@@ -194,30 +194,44 @@ sub fill_rrd ()
my $valid = 0;
#Shorewall-3.2.1 Chains accounting at hellraiser.paragon - Thu Aug 17 23:53:16 CEST 2006
#Shorewall-3.2.1 Chains accounting at hellraiser.paragon - Fri Aug 18 01:46:49 CEST 2006
#
#Counters reset Thu Aug 17 22:42:30 CEST 2006
#Counters reset Fri Aug 18 01:36:57 CEST 2006
#
#Chain accounting (3 references)
# pkts bytes target prot opt in out source destination
# 76 6676 inSGeth0_22 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 22
# 0 0 ouSGeth0_22 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 22
# 93 11336 inSGeth0_25 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 25
# 0 0 ouSGeth0_25 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 25
# 0 0 inSGeth0_53 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 53
# 0 0 ouSGeth0_53 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 53
# 3085 418K inSGeth0_80 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 80
# 0 0 ouSGeth0_80 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 80
# 0 0 inSGeth0_110 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 110
# 0 0 ouSGeth0_110 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 110
# 0 0 inSGeth0_119 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 119
# 0 0 ouSGeth0_119 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 119
# 0 0 inSGeth0_143 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 143
# 0 0 ouSGeth0_143 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 143
# 78 12436 inSGeth0_443 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 443
# 0 0 ouSGeth0_443 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 443
# 0 0 inSGeth0_873 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 873
# 0 0 ouSGeth0_873 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 873
# 0 0 ouSGeth0_22 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 22
# 0 0 ouSGeth0_22 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 22
# 0 0 ouSGeth0_22 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 22
# 0 0 ouSGeth0_22 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 22
# 0 0 inSGeth0_22 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 22
# 0 0 inSGeth0_22 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport sports 22
# 0 0 inSGeth0_22 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 22
# 0 0 inSGeth0_22 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport sports 22
# 0 0 ouSGeth0_25 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 25
# 0 0 ouSGeth0_25 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 25
# 0 0 ouSGeth0_25 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 25
# 0 0 ouSGeth0_25 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 25
# 0 0 inSGeth0_25 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 25
# 0 0 inSGeth0_25 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport sports 25
# 0 0 inSGeth0_25 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 25
# 0 0 inSGeth0_25 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport sports 25
# 0 0 ouSGeth0_53 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 53
# 0 0 ouSGeth0_53 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 53
# 39 2319 ouSGeth0_53 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 53
# 0 0 ouSGeth0_53 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 53
# 0 0 inSGeth0_53 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 53
# 0 0 inSGeth0_53 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport sports 53
# 0 0 inSGeth0_53 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 53
# 34 6605 inSGeth0_53 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport sports 53
# 158 13410 ouSGeth0_80 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 80
# 0 0 ouSGeth0_80 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 80
# 0 0 ouSGeth0_80 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport dports 80
# 0 0 ouSGeth0_80 udp -- * eth0 0.0.0.0/0 0.0.0.0/0 multiport sports 80
# 0 0 inSGeth0_80 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 80
# 163 153K inSGeth0_80 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport sports 80
# 0 0 inSGeth0_80 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 multiport dports 80
#......
foreach my $line (@data) {
......@@ -239,7 +253,7 @@ sub fill_rrd ()
elsif ($2 eq 'K') { $factor = 1024; }
# fill the hash (bytes...
$ports{$4}{$3} = $1 * $factor;
$ports{$4}{$3} += $1 * $factor;
} # end if
} # end foreach
......@@ -259,6 +273,9 @@ sub fill_rrd ()
#print STDERR "port=$port\n";
$updateStr .= ':'. $ports{$port}{'in'} .':'. $ports{$port}{'ou'};
$ports{$port}{'in'} = 0;
$ports{$port}{'ou'} = 0;
}
update_rrd($rrdFile, $rrdTime, $updateStr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment