From 05fab710136dfbc2fb9257a0994ea257e3d059e2 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 20 Mar 2015 09:24:36 +0100 Subject: [PATCH] Skip local hosts --- .../templates/etc/awstats/domain.conf/050SkipHosts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 root/etc/e-smith/templates/etc/awstats/domain.conf/050SkipHosts diff --git a/root/etc/e-smith/templates/etc/awstats/domain.conf/050SkipHosts b/root/etc/e-smith/templates/etc/awstats/domain.conf/050SkipHosts new file mode 100644 index 0000000..a941550 --- /dev/null +++ b/root/etc/e-smith/templates/etc/awstats/domain.conf/050SkipHosts @@ -0,0 +1,17 @@ +{ + +use esmith::NetworksDB; +my $n = esmith::NetworksDB->open_ro() || die "couldn't open networks DB\n"; +my @local = (); +foreach my $net ($n->networks){ + my $key = $net->key; + my $mask = $net->prop('Mask'); + my $prefix = esmith::util::computeLocalNetworkPrefix($key,$mask); + $prefix =~ s/\./\\./g; + $prefix = 'REGEX[^' . $prefix . ']'; + push @local, $prefix; +} + +$OUT .= 'SkipHosts="' . join(' ', @local) . '"'; + +}