mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-14 09:14:40 +02:00
enh(azure/management): force perfdata even if only one backupitem (#3397)
This commit is contained in:
parent
73b1c1608d
commit
0f0e7de88f
@ -61,7 +61,7 @@ sub set_counters {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{maps_counters_type} = [
|
$self->{maps_counters_type} = [
|
||||||
{ name => 'global', type => 0, cb_prefix_output => 'prefix_global_output', cb_init => 'skip_global' },
|
{ name => 'global', type => 0, cb_prefix_output => 'prefix_global_output' },
|
||||||
{ name => 'items', type => 1, cb_prefix_output => 'prefix_item_output', message_multiple => 'All items are ok' }
|
{ name => 'items', type => 1, cb_prefix_output => 'prefix_item_output', message_multiple => 'All items are ok' }
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -96,12 +96,6 @@ sub set_counters {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
sub skip_global {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
|
|
||||||
scalar(keys %{$self->{items}}) == 1 ? return(1) : return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
@ -161,7 +155,7 @@ sub manage_selection {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$self->{global}->{ lc($item->{properties}->{lastBackupStatus}) }++
|
$self->{global}->{ lc($item->{properties}->{lastBackupStatus}) }++
|
||||||
if (defined($item->{properties}->{lastBackupStatus}) && defined($self->{global}->{ lc($item->{properties}->{lastBackupStatus}) }));
|
if (defined($item->{properties}->{lastBackupStatus}) && defined($self->{global}->{ lc($item->{properties}->{lastBackupStatus}) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scalar(keys %{$self->{items}}) <= 0) {
|
if (scalar(keys %{$self->{items}}) <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user