Commit 99ff24bb authored by schlick's avatar schlick

additional ports

parent 18f97788
......@@ -21,6 +21,11 @@ DONE inSGeth0_25
ouSGeth0_25:COUNT - eth0 - tcp 25
DONE ouSGeth0_25
#..............................................................
inSGeth0_53:COUNT - - eth0 tcp 53
DONE inSGeth0_53
ouSGeth0_53:COUNT - eth0 - tcp 53
DONE ouSGeth0_53
#..............................................................
inSGeth0_80:COUNT - - eth0 tcp 80
DONE inSGeth0_80
ouSGeth0_80:COUNT - eth0 - tcp 80
......@@ -36,11 +41,21 @@ DONE inSGeth0_119
ouSGeth0_119:COUNT - eth0 - tcp 119
DONE ouSGeth0_119
#..............................................................
inSGeth0_143:COUNT - - eth0 tcp 143
DONE inSGeth0_143
ouSGeth0_143:COUNT - eth0 - tcp 143
DONE ouSGeth0_143
#..............................................................
inSGeth0_443:COUNT - - eth0 tcp 443
DONE inSGeth0_443
ouSGeth0_443:COUNT - eth0 - tcp 443
DONE ouSGeth0_443
#..............................................................
inSGeth0_873:COUNT - - eth0 tcp 873
DONE inSGeth0_873
ouSGeth0_873:COUNT - eth0 - tcp 873
DONE ouSGeth0_873
#..............................................................
#
###################
# ppp0 #
......@@ -55,6 +70,11 @@ DONE inSGppp0_25
ouSGppp0_25:COUNT - ppp0 - tcp 25
DONE ouSGppp0_25
#..............................................................
inSGppp0_53:COUNT - - ppp0 tcp 53
DONE inSGppp0_53
ouSGppp0_53:COUNT - ppp0 - tcp 53
DONE ouSGppp0_53
#..............................................................
inSGppp0_80:COUNT - - ppp0 tcp 80
DONE inSGppp0_80
ouSGppp0_80:COUNT - ppp0 - tcp 80
......@@ -70,9 +90,19 @@ DONE inSGppp0_119
ouSGppp0_119:COUNT - ppp0 - tcp 119
DONE ouSGppp0_119
#..............................................................
inSGppp0_143:COUNT - - ppp0 tcp 143
DONE inSGppp0_143
ouSGppp0_143:COUNT - ppp0 - tcp 143
DONE ouSGppp0_143
#..............................................................
inSGppp0_443:COUNT - - ppp0 tcp 443
DONE inSGppp0_443
ouSGppp0_443:COUNT - ppp0 - tcp 443
DONE ouSGppp0_443
#..............................................................
inSGppp0_873:COUNT - - ppp0 tcp 873
DONE inSGppp0_873
ouSGppp0_873:COUNT - ppp0 - tcp 873
DONE ouSGppp0_873
#..............................................................
#
......@@ -29,7 +29,7 @@
# /usr/bin/iptraf -s eth0 -L /var/log/iptraf/tcp_udp_services-eth0.log -B
#
#
# $Id: rrd_iptraf.pl,v 1.3 2006/08/15 01:02:03 schlick Exp $
# $Id: rrd_iptraf.pl,v 1.4 2006/08/17 20:56:37 schlick Exp $
#############################################################################
use strict;
use RRDs;
......@@ -41,7 +41,7 @@ use Time::Local;
# the ports of interest
my @PORTS = qw ( 22 25 80 110 119 443 );
my @PORTS = qw ( 22 25 53 80 110 119 143 443 873 );
# path to iptraf
......@@ -166,32 +166,24 @@ sub create_rrd($) {
# d30a12 = 3600*24*30 => 2592000sec/300 /12 => 720; 1h max
# d365a24= 3600*24*365 => 31536000sec/300 /24=> 4380; 2h max
RRDs::create("$rrdFile",
'--step', $rrdStep,
'DS:22_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:22_out:DERIVE:' .($rrdStep*2).':0:U',
'DS:25_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:25_out:DERIVE:' .($rrdStep*2).':0:U',
'DS:80_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:80_out:DERIVE:' .($rrdStep*2).':0:U',
'DS:110_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:110_out:DERIVE:'.($rrdStep*2).':0:U',
'DS:119_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:119_out:DERIVE:'.($rrdStep*2).':0:U',
'DS:443_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:443_out:DERIVE:'.($rrdStep*2).':0:U',
'RRA:AVERAGE:0.5:1:432',
'RRA:AVERAGE:0.5:2:1008',
'RRA:AVERAGE:0.5:6:1440',
'RRA:AVERAGE:0.5:12:8760',
'RRA:MAX:0.5:6:336',
'RRA:MAX:0.5:12:720',
'RRA:MAX:0.5:24:4380'
);
my @createPar = ("$_[0]",
'--step', $rrdStep);
foreach my $port (@ports) {
push (@createPar, 'DS:'. $port . '_in:DERIVE:'.($rrdStep*2).':0:U');
push (@createPar, 'DS:'. $port . '_ou:DERIVE:'.($rrdStep*2).':0:U');
}
push (@createPar, 'RRA:AVERAGE:0.5:1:432');
push (@createPar, 'RRA:AVERAGE:0.5:2:1008');
push (@createPar, 'RRA:AVERAGE:0.5:6:1440');
push (@createPar, 'RRA:AVERAGE:0.5:12:8760');
push (@createPar, 'RRA:MAX:0.5:6:336');
push (@createPar, 'RRA:MAX:0.5:12:720');
push (@createPar, 'RRA:MAX:0.5:24:4380');
#print STDERR join("\n", @createPar). "\n";
RRDs::create @createPar;
my $ERR = RRDs::error;
die "ERROR while creating $rrdFile: $ERR\n" if $ERR;
}
......
......@@ -11,24 +11,37 @@
#
# - connection tracking....
#
# $Id: rrd_shorewallstats.pl,v 1.2 2006/08/17 19:26:09 schlick Exp $
# $Id: rrd_shorewallstats.pl,v 1.3 2006/08/17 20:57:39 schlick Exp $
#############################################################################
use strict;
use RRDs;
my $rrdDatabaseName = 'shorewall.rrd';
my $rrdDatabaseName = 'shorewallstats.rrd';
my $sysconfigFile = '/etc/sysconfig/systemgraph.sysconfig';
# the ports of interest
#22 ssh
#25 smtp
#53 dns
#80 http
#110 pop3
#119 nntp
#143 imap
#443 https
#873 rsync
my %ports = ('22' => { in => 0, ou => 0},
'25' => { in => 0, ou => 0},
'53' => { in => 0, ou => 0},
'80' => { in => 0, ou => 0},
'110' => { in => 0, ou => 0},
'119' => { in => 0, ou => 0},
'143' => { in => 0, ou => 0},
'443' => { in => 0, ou => 0},
'873' => { in => 0, ou => 0},
);
my @ports = ('22','25','80','110','119','443',);
my $counters = 6*2;
my @ports = ('22','25','53','80','110','119','443','873');
my $counters = 18; #9*2
# path to shorewall
......@@ -126,32 +139,25 @@ sub create_rrd($) {
# d30a12 = 3600*24*30 => 2592000sec/300 /12 => 720; 1h max
# d365a24= 3600*24*365 => 31536000sec/300 /24=> 4380; 2h max
RRDs::create("$_[0]",
'--step', $rrdStep,
'DS:22_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:22_out:DERIVE:' .($rrdStep*2).':0:U',
'DS:25_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:25_out:DERIVE:' .($rrdStep*2).':0:U',
'DS:80_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:80_out:DERIVE:' .($rrdStep*2).':0:U',
'DS:110_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:110_out:DERIVE:'.($rrdStep*2).':0:U',
'DS:119_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:119_out:DERIVE:'.($rrdStep*2).':0:U',
'DS:443_in:DERIVE:' .($rrdStep*2).':0:U',
'DS:443_out:DERIVE:'.($rrdStep*2).':0:U',
'RRA:AVERAGE:0.5:1:432',
'RRA:AVERAGE:0.5:2:1008',
'RRA:AVERAGE:0.5:6:1440',
'RRA:AVERAGE:0.5:12:8760',
'RRA:MAX:0.5:6:336',
'RRA:MAX:0.5:12:720',
'RRA:MAX:0.5:24:4380'
);
my @createPar = ("$_[0]",
'--step', $rrdStep);
foreach my $port (@ports) {
push (@createPar, 'DS:'. $port . '_in:DERIVE:'.($rrdStep*2).':0:U');
push (@createPar, 'DS:'. $port . '_ou:DERIVE:'.($rrdStep*2).':0:U');
}
push (@createPar, 'RRA:AVERAGE:0.5:1:432');
push (@createPar, 'RRA:AVERAGE:0.5:2:1008');
push (@createPar, 'RRA:AVERAGE:0.5:6:1440');
push (@createPar, 'RRA:AVERAGE:0.5:12:8760');
push (@createPar, 'RRA:MAX:0.5:6:336');
push (@createPar, 'RRA:MAX:0.5:12:720');
push (@createPar, 'RRA:MAX:0.5:24:4380');
#print STDERR join("\n", @createPar). "\n";
RRDs::create @createPar;
my $ERR = RRDs::error;
die "ERROR while creating $_[0]: $ERR\n" if $ERR;
}
......@@ -166,7 +172,7 @@ sub update_rrd ($$$)
my $dateTime = shift;
my $updateStr = $dateTime . shift;
#printf STDERR "update_rrd: $rrdFile $updateStr \n";
#print STDERR "update_rrd: $rrdFile $updateStr \n";
RRDs::update($rrdFile, $updateStr);
my $ERR = RRDs::error;
......@@ -188,25 +194,6 @@ sub fill_rrd ()
my $valid = 0;
#Shorewall-3.2.1 Chains accounting at hellraiser.paragon - Wed Aug 16 00:36:38 CEST 2006
#
#Counters reset Tue Aug 15 23:52:49 CEST 2006
#
#Chain accounting (3 references)
# pkts bytes target prot opt in out source destination
# 204K 19M inSGeth0_22 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
# 0 0 ouSGeth0_22 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
# 0 0 inSGeth0_25 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:25
# 0 0 ouSGeth0_25 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25
#29161 3099K inSGeth0_80 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
# 0 0 ouSGeth0_80 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
# 1155 66624 inSGeth0_110 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:110
# 0 0 ouSGeth0_110 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:110
# 0 0 inSGeth0_119 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:119
# 0 0 ouSGeth0_119 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:119
# 0 0 inSGeth0_443 tcp -- * eth0 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
# 0 0 ouSGeth0_443 tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
foreach my $line (@data) {
#print STDERR "RAW1: $line";
......
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