enh(azure/management): force perfdata even if only one backupitem (#3397)

This commit is contained in:
Simon Bomm 2022-01-11 15:42:32 +01:00 committed by GitHub
parent 73b1c1608d
commit 0f0e7de88f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {