mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
zenus_: Let's try fixing that compilation error again
This commit is contained in:
parent
73c0ad7797
commit
5c671ba157
@ -106,7 +106,7 @@ if ($CAN_LOG) {
|
|||||||
Log::Log4perl::init( \$loggerconf );
|
Log::Log4perl::init( \$loggerconf );
|
||||||
our $logger = Log::Log4perl->get_logger($ACCT);
|
our $logger = Log::Log4perl->get_logger($ACCT);
|
||||||
} else {
|
} else {
|
||||||
our $logger = undef;
|
our $logger = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $lastread;
|
my $lastread;
|
||||||
@ -129,7 +129,7 @@ sub save_data {
|
|||||||
push @save_vector, $_ . '¬' . $hashref->{$_};
|
push @save_vector, $_ . '¬' . $hashref->{$_};
|
||||||
}
|
}
|
||||||
|
|
||||||
$logger->info(
|
$::logger->info(
|
||||||
"Saving Data (LastRead is " . localtime($lastread) . "\n" )
|
"Saving Data (LastRead is " . localtime($lastread) . "\n" )
|
||||||
if $CAN_LOG;
|
if $CAN_LOG;
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ sub load_data {
|
|||||||
|
|
||||||
# Data is stale
|
# Data is stale
|
||||||
print "# Data is " . ( time - $lastread ) . " seconds old\n";
|
print "# Data is " . ( time - $lastread ) . " seconds old\n";
|
||||||
$logger->info( "Data is " . ( time - $lastread ) . " seconds old\n" )
|
$::logger->info( "Data is " . ( time - $lastread ) . " seconds old\n" )
|
||||||
if $CAN_LOG;
|
if $CAN_LOG;
|
||||||
|
|
||||||
if ( exists $hashref->{backoff} ) {
|
if ( exists $hashref->{backoff} ) {
|
||||||
@ -164,13 +164,13 @@ sub load_data {
|
|||||||
|
|
||||||
# We're in a back-off period
|
# We're in a back-off period
|
||||||
print "# Back-off in effect\n";
|
print "# Back-off in effect\n";
|
||||||
$logger->info("Back-off in effect\n") if $CAN_LOG;
|
$::logger->info("Back-off in effect\n") if $CAN_LOG;
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# We've just come out of a back-off period
|
# We've just come out of a back-off period
|
||||||
print "# Back-off ends\n";
|
print "# Back-off ends\n";
|
||||||
$logger->info("Back-off ends\n") if $CAN_LOG;
|
$::logger->info("Back-off ends\n") if $CAN_LOG;
|
||||||
delete $hashref->{backoff};
|
delete $hashref->{backoff};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ sub load_data {
|
|||||||
# back-off for 24 hours.
|
# back-off for 24 hours.
|
||||||
print "# Starting Back-Off\n";
|
print "# Starting Back-Off\n";
|
||||||
$hashref->{backoff} = time + ( 24 * 60 * 60 );
|
$hashref->{backoff} = time + ( 24 * 60 * 60 );
|
||||||
$logger->info(
|
$::logger->info(
|
||||||
"Backing off until " . localtime( $hashref->{backoff} ) . "\n" )
|
"Backing off until " . localtime( $hashref->{backoff} ) . "\n" )
|
||||||
if $CAN_LOG;
|
if $CAN_LOG;
|
||||||
save_data( $hashref, 0 );
|
save_data( $hashref, 0 );
|
||||||
@ -194,7 +194,7 @@ sub load_data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "# REFRESHING DATA\n";
|
print "# REFRESHING DATA\n";
|
||||||
$logger->info("Refreshing Data\n") if $CAN_LOG;
|
$::logger->info("Refreshing Data\n") if $CAN_LOG;
|
||||||
my $temphash;
|
my $temphash;
|
||||||
eval {
|
eval {
|
||||||
zenus::login( $USER, $PASS );
|
zenus::login( $USER, $PASS );
|
||||||
@ -223,7 +223,7 @@ sub load_data {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "# Using existing data\n";
|
print "# Using existing data\n";
|
||||||
$logger->info("Using existing data\n") if $CAN_LOG;
|
$::logger->info("Using existing data\n") if $CAN_LOG;
|
||||||
}
|
}
|
||||||
save_data( $hashref, 1 ) if $force_save;
|
save_data( $hashref, 1 ) if $force_save;
|
||||||
return $hashref;
|
return $hashref;
|
||||||
|
Loading…
Reference in New Issue
Block a user