From fea84ffc20b6fd65d239fde7695635df1cf5c0f4 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Thu, 24 Nov 2016 04:00:36 +0100 Subject: [PATCH 1/4] travis: do not import missing File::Tail::Multi --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 474a3a9d..dd210c31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,6 @@ install: - cpanm --notest Device::SerialPort - cpanm --notest FCGI::Client - cpanm --notest File::ReadBackwards - - cpanm --notest File::Tail::Multi - cpanm --notest Graphics::ColorObject - cpanm --notest IPC::Run3 - cpanm --notest IPC::ShareLite @@ -55,6 +54,7 @@ install: # - Sys::Virt version matching the test system's libvirt-dev - cpanm --notest DANBERR/Sys-Virt-0.9.8.tar.gz # Modules used by plugins, but missing on cpan + # - File::Tail::Multi # - Sun::Solaris::Kstat # - VMware::VIRuntime # - MythTV From 02f80a35a31ec1be979566e5e3d25a151732969b Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Fri, 25 Nov 2016 02:17:41 +0100 Subject: [PATCH 2/4] [apache_logparser] carefully import unavailable module 'File::Tail::Multi this will allow travis checks again --- plugins/apache/apache_vhosts/apache_logparser | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/apache/apache_vhosts/apache_logparser b/plugins/apache/apache_vhosts/apache_logparser index 434ea0f9..22456298 100644 --- a/plugins/apache/apache_vhosts/apache_logparser +++ b/plugins/apache/apache_vhosts/apache_logparser @@ -45,7 +45,9 @@ local $debug=0; my $scan_interval=5; # minutes # perl modules -use File::Tail::Multi; +# "File:Tail:Multi" disappeared from CPAN (somewhen in 2016) - thus it needs +# to be imported carefully (for travis checks). +eval 'use File::Tail::Multi; 1;' or die 'Please install File::Tail::Multi'; use Storable qw(freeze thaw); use List::Util qw(min max); use IPC::ShareLite ':lock'; From 89b2f76701ebefe2719a40567e7657e8fd9dabae Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Fri, 25 Nov 2016 02:18:29 +0100 Subject: [PATCH 3/4] [apache_logparser] fix syntax error of for-loop --- plugins/apache/apache_vhosts/apache_logparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apache/apache_vhosts/apache_logparser b/plugins/apache/apache_vhosts/apache_logparser index 22456298..1f3ddcb7 100644 --- a/plugins/apache/apache_vhosts/apache_logparser +++ b/plugins/apache/apache_vhosts/apache_logparser @@ -169,7 +169,7 @@ while (1) { $old{$vpm}{'max_bytes'}=max($old{$vpm}{'max_bytes'},$temp{$vpm}{'max_bytes'}) || 0; # reset local counters - foreach my $check qw(requests bytes time max_bytes avg_bytes max_time avg_time) { + foreach my $check (qw(requests bytes time max_bytes avg_bytes max_time avg_time)) { $temp{$vpm}{$check}=0; } From 3d3f5179fa3cfdb7f949c87ffc691c7e4e32bc91 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Fri, 25 Nov 2016 02:23:19 +0100 Subject: [PATCH 4/4] [apache_logparser] remove unused 'type' setting the manual common/combined type detection was replaced with an automatism earlier --- plugins/apache/apache_vhosts/apache_logparser | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/apache/apache_vhosts/apache_logparser b/plugins/apache/apache_vhosts/apache_logparser index 1f3ddcb7..1f427b5e 100644 --- a/plugins/apache/apache_vhosts/apache_logparser +++ b/plugins/apache/apache_vhosts/apache_logparser @@ -27,9 +27,6 @@ $statefile file to save last log position for tail $nsec tail and write to shared mem every n seconds $debug dump tallied data every n seconds, print every log line parsed $scan_interval rescan for new log files every n minutes -$type log file type: - common: CLF + vhost + time + (other fields) - combined: combined + time + (other fields) =cut # config @@ -38,7 +35,6 @@ my $files = "*access_log"; my $site = "(.*)-access_log"; my $statefile = "/tmp/logstate"; `touch $statefile` unless (-f $statefile); -local $type="combined"; local $nsec=7; local $debug=0;