add missing package
This commit is contained in:
parent
c7d97547c8
commit
2b08bbb6aa
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter);
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Cache::File;
|
||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
||||
|
||||
sub new {
|
||||
|
|
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter);
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Cache::File;
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
sub new {
|
||||
|
@ -49,14 +50,6 @@ sub manage_selection {
|
|||
# Alerts management
|
||||
my $cache = Cache::File->new( cache_root => './parity-eth-poller-cache' );
|
||||
|
||||
if (my $cached_balance = $cache->get('contract_balance')) {
|
||||
if ($cached_balance != $contract->{balance}) {
|
||||
#alert
|
||||
}
|
||||
} else {
|
||||
$cache->set('contract_balance', $contract->{balance});
|
||||
}
|
||||
|
||||
foreach my $account (@{$results->{Accounts}}) {
|
||||
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
||||
$account->{id} !~ /$self->{option_results}->{filter_name}/) {
|
||||
|
@ -90,6 +83,15 @@ sub manage_selection {
|
|||
$self->{output}->output_add(severity => 'OK', long_msg => '[Contract ' . $contract->{id} . ']: label: ' . $contract->{label} . ' | balance: ' . $contract->{balance} .
|
||||
' | timestamp: ' . localtime(hex($contract->{last_update}->{timestamp})) . ' | blockNumber: ' . $contract->{last_update}->{blockNumber} .
|
||||
' | sender: ' . $contract->{last_update}->{sender} . ' | value: ' . $contract->{last_update}->{value} );
|
||||
|
||||
if (my $cached_balance = $cache->get('contract_balance_' . $contract->{id})) {
|
||||
if ($cached_balance != $contract->{balance}) {
|
||||
#alert
|
||||
}
|
||||
} else {
|
||||
$cache->set('contract_balance_' . $contract->{id}, $contract->{balance});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach my $function (@{$results->{Functions}}) {
|
||||
|
|
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter);
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Cache::File;
|
||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
||||
|
||||
sub custom_status_output {
|
||||
|
|
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter);
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Cache::File;
|
||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
||||
|
||||
sub custom_status_output {
|
||||
|
|
Loading…
Reference in New Issue