Skip to content

Commit 816b081

Browse files
authored
fix(database::mssql): trim instances names (#6239)
Refs: CTOR-2286
1 parent 3f1f1b0 commit 816b081

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/database/mssql/mode/deadlocks.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use strict;
2424
use warnings;
2525
use base qw(centreon::plugins::templates::counter);
2626
use centreon::plugins::constants qw(:counters);
27-
use centreon::plugins::misc qw(is_excluded);
27+
use centreon::plugins::misc qw(is_excluded trim);
2828
use Digest::SHA qw(sha256_hex);
2929

3030
sub prefix_by_instance_output {
@@ -100,6 +100,8 @@ sub manage_selection {
100100

101101
foreach my $row (@{$query_result}) {
102102
my ($instance, $value) = @$row;
103+
$instance = trim($instance);
104+
103105
next if $instance eq '_Total';
104106
next if is_excluded($instance, $self->{option_results}->{include_instance}, $self->{option_results}->{exclude_instance}, output => $self->{output});
105107
$self->{by_instance}->{$instance} = {

src/database/mssql/mode/lockswaits.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use strict;
2424
use warnings;
2525
use base qw(centreon::plugins::templates::counter);
2626
use centreon::plugins::constants qw(:counters);
27-
use centreon::plugins::misc qw(is_excluded);
27+
use centreon::plugins::misc qw(is_excluded trim);
2828
use Digest::SHA qw(sha256_hex);
2929

3030
sub prefix_by_instance_output {
@@ -102,6 +102,8 @@ sub manage_selection {
102102

103103
foreach my $row (@{$query_result}) {
104104
my ($instance, $value) = @$row;
105+
$instance = trim($instance);
106+
105107
next if $instance eq '_Total';
106108
next if is_excluded($instance, $self->{option_results}->{include_instance}, $self->{option_results}->{exclude_instance}, output => $self->{output});
107109
$self->{by_instance}->{$instance} = {

0 commit comments

Comments
 (0)