mirror of
https://github.com/manuelkasper/AS-Stats.git
synced 2025-02-20 11:44:12 +08:00
Allow separate samplerates for in/out traffic
This commit is contained in:
parent
fafb2417f4
commit
586e5f2d2c
@ -714,6 +714,9 @@ sub flush_cache {
|
|||||||
|
|
||||||
my $tag = $dsname;
|
my $tag = $dsname;
|
||||||
$tag =~ s/(_v6)?_(in|out)$//;
|
$tag =~ s/(_v6)?_(in|out)$//;
|
||||||
|
if ($dsname =~ /_(in|out)$/) {
|
||||||
|
$tag = "${1}_${tag}";
|
||||||
|
}
|
||||||
my $cursamplingrate = $link_samplingrates{$tag};
|
my $cursamplingrate = $link_samplingrates{$tag};
|
||||||
|
|
||||||
push(@templatearg, $dsname);
|
push(@templatearg, $dsname);
|
||||||
@ -794,12 +797,19 @@ sub read_knownlinks {
|
|||||||
|
|
||||||
my ($routerip,$ifindex,$tag,$descr,$color,$linksamplingrate) = split(/\t+/);
|
my ($routerip,$ifindex,$tag,$descr,$color,$linksamplingrate) = split(/\t+/);
|
||||||
$knownlinks_tmp{"${routerip}_${ifindex}"} = $tag;
|
$knownlinks_tmp{"${routerip}_${ifindex}"} = $tag;
|
||||||
|
|
||||||
unless(defined($linksamplingrate) && $linksamplingrate =~ /^\d+$/) {
|
my ($samplein,$sampleout) = split('/', $linksamplingrate);
|
||||||
|
unless(defined($sampleout) && $sampleout =~ /^\d+$/) {
|
||||||
|
$sampleout = $samplein;
|
||||||
|
}
|
||||||
|
|
||||||
|
unless(defined($samplein) && $samplein =~ /^\d+$/) {
|
||||||
die("ERROR: No samplingrate for ".$routerip."\n");
|
die("ERROR: No samplingrate for ".$routerip."\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$link_samplingrates_tmp{$tag} = $linksamplingrate;
|
$link_samplingrates_tmp{"in_$tag"} = $samplein;
|
||||||
|
$link_samplingrates_tmp{"out_$tag"} = $sampleout;
|
||||||
|
#print "DEBUG Sampling Rate for ${routerip}_${ifindex} is IN: $samplein | OUT: $sampleout\n";
|
||||||
}
|
}
|
||||||
close(KLFILE);
|
close(KLFILE);
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Router IP SNMP ifindex[/VLAN] tag description color samplingrate
|
# Router IP SNMP ifindex[/VLAN] tag description color samplingrate
|
||||||
# note: tabs must be used to separate fields (not spaces)
|
# note: tabs must be used to separate fields (not spaces)
|
||||||
# max. length for tag is 12 characters; allowed characters: a-z A-Z 0-9 _
|
# max. length for tag is 12 characters; allowed characters: a-z A-Z 0-9 _
|
||||||
|
# sampling rate can be separate for in/out by specifying <in>/<out> rates.
|
||||||
192.0.2.1 15 uplink1 Uplink 1 A6CEE3 1
|
192.0.2.1 15 uplink1 Uplink 1 A6CEE3 1
|
||||||
192.0.2.1 23 uplink2 Uplink 2 1F78B4 1
|
192.0.2.1 23 uplink2 Uplink 2 1F78B4 1
|
||||||
192.0.2.2 4 uplink3 Uplink 3 B2DF8A 1
|
192.0.2.2 4 uplink3 Uplink 3 B2DF8A 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user