diff --git a/centreon-plugins/database/mssql/mode/cachehitratio.pm b/centreon-plugins/database/mssql/mode/cachehitratio.pm index e817f2f81..601d7397c 100644 --- a/centreon-plugins/database/mssql/mode/cachehitratio.pm +++ b/centreon-plugins/database/mssql/mode/cachehitratio.pm @@ -73,7 +73,7 @@ sub manage_selection { ) }); - my $hitratio = $self->{sql}->fetchrow_array(); + my $hitratio = $options{sql}->fetchrow_array(); $self->{hit_ratio}->{value} = $hitratio; } diff --git a/centreon-plugins/database/mssql/mode/connectedusers.pm b/centreon-plugins/database/mssql/mode/connectedusers.pm index 8a1b7d0bf..3ebce965e 100644 --- a/centreon-plugins/database/mssql/mode/connectedusers.pm +++ b/centreon-plugins/database/mssql/mode/connectedusers.pm @@ -59,7 +59,7 @@ sub manage_selection { $options{sql}->connect(); $options{sql}->query(query => q{SELECT count(*) FROM master..sysprocesses WHERE spid >= '51'}); - my $connected_count = $self->{sql}->fetchrow_array(); + my $connected_count = $options{sql}->fetchrow_array(); $self->{connected_user}->{value} = $connected_count; } diff --git a/centreon-plugins/database/mssql/mode/deadlocks.pm b/centreon-plugins/database/mssql/mode/deadlocks.pm index 1a2e46f83..c62b83904 100644 --- a/centreon-plugins/database/mssql/mode/deadlocks.pm +++ b/centreon-plugins/database/mssql/mode/deadlocks.pm @@ -71,7 +71,7 @@ sub manage_selection { counter_name = 'Number of Deadlocks/sec%' }); - my $query_result = $self->{sql}->fetchall_arrayref(); + my $query_result = $options{sql}->fetchall_arrayref(); $self->{deadlocks}->{value} = 0; foreach my $row (@{$query_result}) { diff --git a/centreon-plugins/database/mssql/mode/lockswaits.pm b/centreon-plugins/database/mssql/mode/lockswaits.pm index eb624dc65..b49d9611e 100644 --- a/centreon-plugins/database/mssql/mode/lockswaits.pm +++ b/centreon-plugins/database/mssql/mode/lockswaits.pm @@ -31,7 +31,7 @@ sub set_counters { { name => 'lockswaits', type => 0 }, ]; - $self->{maps_counters}->{deadlocks} = [ + $self->{maps_counters}->{lockswaits} = [ { label => 'lockswaits', nlabel => 'mssql.lockswaits.count', set => { key_values => [ { name => 'value' } ], output_template => '%.2f dead locks/s', @@ -71,7 +71,7 @@ sub manage_selection { counter_name = 'Lock Waits/sec%' }); - my $query_result = $self->{sql}->fetchall_arrayref(); + my $query_result = $options{sql}->fetchall_arrayref(); $self->{lockswaits}->{value} = 0; foreach my $row (@{$query_result}) {