check_mssql_health icon indicating copy to clipboard operation
check_mssql_health copied to clipboard

Transaction Error when running check_mssql_health

Open rajav2 opened this issue 9 years ago • 15 comments

I am getting the following transaction error for all modes. It is the same with other DB servers. Please advice

[nagios@nagiosprodxi1 libexec]$ ./check_mssql_health -V check_mssql_health (1.5.20.5) This nagios plugin comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of this plugin under the terms of the GNU General Public License.

[nagios@nagiosprodxi1 libexec]$ ./check_mssql_health --server CRDE_SG_UAT --username appsmonitor --password abc1* --mode connection-time --warning 5 --critical 10 OK - 0.17 seconds to connect as appsmonitor | connection_time=0.17;5;10 DBD::Sybase::db DESTROY failed: Server message number=3903 severity=16 state=1 line=2 server=BHQKPK200020 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. Server message number=3903 severity=16 state=1 line=2 server=BHQKPK200020 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. during global destruction. (in cleanup) DBD::Sybase::db DESTROY failed: Server message number=3903 severity=16 state=1 line=2 server=BHQKPK200020 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. Server message number=3903 severity=16 state=1 line=2 server=BHQKPK200020 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. during global destruction.

rajav2 avatar Jul 17 '14 03:07 rajav2

BTW it had the same problem with Version 1.5.19.3

rajav2 avatar Jul 17 '14 03:07 rajav2

Same with 1.5.20.6

nE0sIghT avatar May 18 '15 09:05 nE0sIghT

I have the same problem with the latest version.

I searched a solution from here, it works for me.

The behavior of either dbd::sybase or freetds changed (this error message appeared suddenly at the beginning of this year and only with certain linux distributions)

You have to add "--commit"。

Gerhard

kylexlau avatar Nov 26 '18 04:11 kylexlau

There's another solution. When you install DBD-Sybase module, choose 'N' when asked to use 'CHAINED' mode by default.

By default DBD::Sybase 1.05 and later use the 'CHAINED' mode (where available) when 'AutoCommit' is turned off. Versions 1.04 and older instead managed the transactions explicitly with a 'BEGIN TRAN' before the first DML statement. Using the 'CHAINED' mode is preferable as it is the way that Sybase implements AutoCommit handling for both its ODBC and JDBC drivers.

Use 'CHAINED' mode by default (Y/N) [Y]: N

kylexlau avatar Nov 26 '18 04:11 kylexlau

I have the same problem with the latest version.

I searched a solution from here, it works for me.

The behavior of either dbd::sybase or freetds changed (this error message appeared suddenly at the beginning of this year and only with certain linux distributions) You have to add "--commit"。 Gerhard

I'm not authorised to read this forum. I created an account and I still can't. Can u help me?

Rerhinson avatar Nov 10 '20 18:11 Rerhinson

I have no access to this forum, it is for customers of Nagios Inc.

Adding --commit by default is the way to go.

Gerhard

Von: Rerhinson [mailto:[email protected]] Gesendet: Dienstag, 10. November 2020 19:15 An: lausser/check_mssql_health [email protected] Cc: Subscribed [email protected] Betreff: Re: [lausser/check_mssql_health] Transaction Error when running check_mssql_health (#7)

I have the same problem with the latest version.

I searched a solution from here https://support.nagios.com/forum/viewtopic.php?f=6&t=28718 , it works for me.

The behavior of either dbd::sybase or freetds changed (this error message appeared suddenly at the beginning of this year and only with certain linux distributions) You have to add "--commit"。 Gerhard

I'm not authorised to read this forum. I created an account and I still can't. Can u help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lausser/check_mssql_health/issues/7#issuecomment-724876739 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AABQSODR2IS2H22DMSIQVQLSPF7JNANCNFSM4ARYAVSA .

lausser avatar Nov 10 '20 20:11 lausser

I have no access to this forum, it is for customers of Nagios Inc. Adding --commit by default is the way to go. Gerhard Von: Rerhinson [mailto:[email protected]] Gesendet: Dienstag, 10. November 2020 19:15 An: lausser/check_mssql_health [email protected] Cc: Subscribed [email protected] Betreff: Re: [lausser/check_mssql_health] Transaction Error when running check_mssql_health (#7) I have the same problem with the latest version. I searched a solution from here https://support.nagios.com/forum/viewtopic.php?f=6&t=28718 , it works for me. The behavior of either dbd::sybase or freetds changed (this error message appeared suddenly at the beginning of this year and only with certain linux distributions) You have to add "--commit"。 Gerhard I'm not authorised to read this forum. I created an account and I still can't. Can u help me? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#7 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/AABQSODR2IS2H22DMSIQVQLSPF7JNANCNFSM4ARYAVSA .

The check passes, but does not collect the correct information it should. It returns OK status, but it is a false positive.

Rerhinson avatar Nov 11 '20 11:11 Rerhinson

"The check passes," Which check?

lausser avatar Nov 11 '20 12:11 lausser

It is a backup check, it should return to the status information with the time of the last backup but it only comes with "ok".

Like this => image

Rerhinson avatar Nov 11 '20 12:11 Rerhinson

How do you think i can help you with nothing more than a screenshot and "Shows OK, but is false positive" at hand?

lausser avatar Nov 11 '20 12:11 lausser

Sorry, I just wanted to show you how it was being shown.

image

DBD::Sybase::db DESTROY failed: Server message number=3903 severity=16 state=1 line=2 server=CLIG525 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. Server message number=3903 severity=16 state=1 line=2 server=CLIG525 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. during global destruction. (in cleanup) DBD::Sybase::db DESTROY failed: Server message number=3903 severity=16 state=1 line=2 server=CLIG525 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. Server message number=3903 severity=16 state=1 line=2 server=CLIG525 text=The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. during global destruction.

Rerhinson avatar Nov 11 '20 12:11 Rerhinson

You see the sql communication when you add "-vvv" to the command line.

lausser avatar Nov 11 '20 12:11 lausser

[nagios@nagios ~]$ /usr/local/nagios/libexec/check_mssql_health --server 10.0.0. --username nagios_secrel --password "S1" --mode database-backup-age --warning 24 --critical 48 --name msdb --commit -vvv Wed Nov 11 10:34:43 2020: SQL: SELECT @@VERSION ARGS: $VAR1 = [];

Wed Nov 11 10:34:43 2020: RESULT: $VAR1 = [ 'Microsoft SQL Server 2014 - 12.0.4100.1 (X64) Apr 20 2015 17:29:27 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor) ' ];

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::override_opt

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::check_messages

Wed Nov 11 10:34:43 2020: SQL: SELECT SYSTEM_USER ARGS: $VAR1 = [];

Wed Nov 11 10:34:43 2020: RESULT: $VAR1 = [ 'nagios_secrel' ];

Wed Nov 11 10:34:43 2020: SQL: SELECT @@SERVICENAME ARGS: $VAR1 = [];

Wed Nov 11 10:34:43 2020: RESULT: $VAR1 = [ 'MSSQLSERVER' ];

Wed Nov 11 10:34:43 2020: SQL: SELECT CAST(COALESCE(SERVERPROPERTY('IsHadrEnabled'), 0) as int) ARGS: $VAR1 = [];

Wed Nov 11 10:34:43 2020: RESULT: $VAR1 = [ 0 ];

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::analyze_and_check_database_subsystem

Wed Nov 11 10:34:43 2020: SQL:

      SELECT
          d.name AS database_name, d.recovery_model, bs1.last_backup, bs1.last_duration, d.state, d.state_desc
      FROM
          sys.databases d
      LEFT JOIN (
        SELECT
            bs.database_name,
            DATEDIFF(HH, MAX(bs.backup_finish_date), GETDATE()) AS last_backup,
            DATEDIFF(MI, MAX(bs.backup_start_date), MAX(bs.backup_finish_date)) AS last_duration
        FROM
            msdb.dbo.backupset bs WITH (NOLOCK)
        WHERE
            bs.type IN ('D', 'I')
        GROUP BY
            bs.database_name
      ) bs1 ON
          d.name = bs1.database_name WHERE d.source_database_id IS NULL
      ORDER BY
          d.name
    

ARGS: $VAR1 = [];

Wed Nov 11 10:34:43 2020: RESULT: $VAR1 = [ [ 'master', 3, 400, 0, 0, 'ONLINE' ], [ 'tempdb', 3, undef, undef, 0, 'ONLINE' ] ];

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::Component::DatabaseSubsystem::DatabaseStub::override_opt

Wed Nov 11 10:34:43 2020: $self->{components}->{database_subsystem} = Classes::MSSQL::Component::DatabaseSubsystem->new() Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::check_database_subsystem

[DATABASESUBSYSTEM] info: checking databases

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::reduce_messages_short

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::check_messages

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::check_messages

Wed Nov 11 10:34:43 2020: AUTOLOAD Classes::MSSQL::DBI::nagios_exit

OK - checking databases

Rerhinson avatar Nov 11 '20 13:11 Rerhinson

msdb is not among the sql response, probably not listed in msdb.dbo.backupset. So there is no backup configured for msdb?

lausser avatar Nov 11 '20 15:11 lausser

There is a maintenance plan and I checked the bakcup. I check a table msdb.dbo.backupset. So my doubt, I thought it would be some parameter.

Rerhinson avatar Nov 11 '20 17:11 Rerhinson