mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
Merge pull request #777 from sumpfralle/travis-remove-file_tail_multi
[apache_logparser] carefully import missing File::Tail::Multi (fixes Travis checks)
This commit is contained in:
commit
9057a61fa6
2 changed files with 5 additions and 7 deletions
|
@ -24,7 +24,6 @@ install:
|
||||||
- cpanm --notest Device::SerialPort
|
- cpanm --notest Device::SerialPort
|
||||||
- cpanm --notest FCGI::Client
|
- cpanm --notest FCGI::Client
|
||||||
- cpanm --notest File::ReadBackwards
|
- cpanm --notest File::ReadBackwards
|
||||||
- cpanm --notest File::Tail::Multi
|
|
||||||
- cpanm --notest Graphics::ColorObject
|
- cpanm --notest Graphics::ColorObject
|
||||||
- cpanm --notest IPC::Run3
|
- cpanm --notest IPC::Run3
|
||||||
- cpanm --notest IPC::ShareLite
|
- cpanm --notest IPC::ShareLite
|
||||||
|
@ -55,6 +54,7 @@ install:
|
||||||
# - Sys::Virt version matching the test system's libvirt-dev
|
# - Sys::Virt version matching the test system's libvirt-dev
|
||||||
- cpanm --notest DANBERR/Sys-Virt-0.9.8.tar.gz
|
- cpanm --notest DANBERR/Sys-Virt-0.9.8.tar.gz
|
||||||
# Modules used by plugins, but missing on cpan
|
# Modules used by plugins, but missing on cpan
|
||||||
|
# - File::Tail::Multi
|
||||||
# - Sun::Solaris::Kstat
|
# - Sun::Solaris::Kstat
|
||||||
# - VMware::VIRuntime
|
# - VMware::VIRuntime
|
||||||
# - MythTV
|
# - MythTV
|
||||||
|
|
|
@ -27,9 +27,6 @@ $statefile file to save last log position for tail
|
||||||
$nsec tail and write to shared mem every n seconds
|
$nsec tail and write to shared mem every n seconds
|
||||||
$debug dump tallied data every n seconds, print every log line parsed
|
$debug dump tallied data every n seconds, print every log line parsed
|
||||||
$scan_interval rescan for new log files every n minutes
|
$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
|
=cut
|
||||||
|
|
||||||
# config
|
# config
|
||||||
|
@ -38,14 +35,15 @@ my $files = "*access_log";
|
||||||
my $site = "(.*)-access_log";
|
my $site = "(.*)-access_log";
|
||||||
my $statefile = "/tmp/logstate";
|
my $statefile = "/tmp/logstate";
|
||||||
`touch $statefile` unless (-f $statefile);
|
`touch $statefile` unless (-f $statefile);
|
||||||
local $type="combined";
|
|
||||||
local $nsec=7;
|
local $nsec=7;
|
||||||
local $debug=0;
|
local $debug=0;
|
||||||
|
|
||||||
my $scan_interval=5; # minutes
|
my $scan_interval=5; # minutes
|
||||||
|
|
||||||
# perl modules
|
# 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 Storable qw(freeze thaw);
|
||||||
use List::Util qw(min max);
|
use List::Util qw(min max);
|
||||||
use IPC::ShareLite ':lock';
|
use IPC::ShareLite ':lock';
|
||||||
|
@ -167,7 +165,7 @@ while (1) {
|
||||||
$old{$vpm}{'max_bytes'}=max($old{$vpm}{'max_bytes'},$temp{$vpm}{'max_bytes'}) || 0;
|
$old{$vpm}{'max_bytes'}=max($old{$vpm}{'max_bytes'},$temp{$vpm}{'max_bytes'}) || 0;
|
||||||
|
|
||||||
# reset local counters
|
# 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;
|
$temp{$vpm}{$check}=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue