mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
updated apache_vhost to actually work (at least on my debian squeeze machine..): Surrounded thaw by eval{} to suppress error at the very first run and escaped "." and "-" at the sanitizing regex in apache_pipelogger
This commit is contained in:
parent
27e4cf0fe3
commit
672fd1c32a
3 changed files with 5 additions and 5 deletions
|
@ -150,7 +150,7 @@ while (1) {
|
|||
$share->lock(LOCK_EX);
|
||||
|
||||
# get data (may be updated by other loggers too)
|
||||
my %old=%{thaw $share->fetch};
|
||||
my %old=eval{%{thaw($share->fetch)}}; # using eval to suppress thaw error on empty string at the first run
|
||||
|
||||
foreach my $vpm (keys %temp){
|
||||
# merge values
|
||||
|
|
|
@ -39,7 +39,7 @@ while (<STDIN>) {
|
|||
my ($vhost,$port,$method,$bytes,$time,$status)=split(/\s/,$_);
|
||||
|
||||
# sanity check
|
||||
next unless m/^([\d\w.-_]+\s){5}([\d\w.-_]+$)/;
|
||||
next unless m/^([\d\w\.\-_]+\s){5}([\d\w\.\-_]+$)/; # escaped "." and "-"
|
||||
$time=sprintf("%d",$time/1000); # microsec to millisec
|
||||
|
||||
# sitename to munin fieldname
|
||||
|
@ -85,7 +85,7 @@ sub periodic_write {
|
|||
$share->lock(LOCK_EX);
|
||||
|
||||
# get data (may be updated by other loggers too)
|
||||
my %old=%{thaw $share->fetch};
|
||||
my %old=eval{%{thaw($share->fetch)}}; # using eval to suppress thaw error on empty string at the first run
|
||||
|
||||
foreach my $vpm (keys %temp){
|
||||
# merge values
|
||||
|
@ -120,4 +120,4 @@ sub periodic_write {
|
|||
|
||||
# parse/write every n seconds
|
||||
alarm $nsec;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ my $share = IPC::ShareLite->new(
|
|||
) or die $!;
|
||||
|
||||
|
||||
my %data=%{thaw $share->fetch};
|
||||
my %data=eval{%{thaw($share->fetch)}}; # using eval to suppress thaw error on empty string at the first run
|
||||
|
||||
if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) {
|
||||
if (scalar(keys %data)>0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue