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 strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Cache::File;
|
||||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
|
|
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Cache::File;
|
||||||
use Digest::MD5 qw(md5_hex);
|
use Digest::MD5 qw(md5_hex);
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
|
@ -49,14 +50,6 @@ sub manage_selection {
|
||||||
# Alerts management
|
# Alerts management
|
||||||
my $cache = Cache::File->new( cache_root => './parity-eth-poller-cache' );
|
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}}) {
|
foreach my $account (@{$results->{Accounts}}) {
|
||||||
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
||||||
$account->{id} !~ /$self->{option_results}->{filter_name}/) {
|
$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} .
|
$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} .
|
' | timestamp: ' . localtime(hex($contract->{last_update}->{timestamp})) . ' | blockNumber: ' . $contract->{last_update}->{blockNumber} .
|
||||||
' | sender: ' . $contract->{last_update}->{sender} . ' | value: ' . $contract->{last_update}->{value} );
|
' | 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}}) {
|
foreach my $function (@{$results->{Functions}}) {
|
||||||
|
|
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Cache::File;
|
||||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
||||||
|
|
||||||
sub custom_status_output {
|
sub custom_status_output {
|
||||||
|
|
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::counter);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Cache::File;
|
||||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
|
||||||
|
|
||||||
sub custom_status_output {
|
sub custom_status_output {
|
||||||
|
|
Loading…
Reference in New Issue