Page 1 of 2

Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Wed Apr 02, 2014 8:02 am
by detronict
When using the wizard for "MSSQL Database" I am presented with the option to monitor LogFileUsage.
The result is always unsuccessful. The reason for this i think is the fact that the information is gathered from sysperfinfo.

The sysperfinfo table is only available in the master database, so using this on an individual database (other than master) results in failure.

I hope i am wrong and someone can tell me what i am doing wrong, because we would like to see this info for individual databases.

If i am right, can someone recommend an other method to do this?

If I am in the wrong place for this question please let me know where i should go.

Hoping for a response (and a solution),

Regards,

detronict
Rik Lijkendijk

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Wed Apr 02, 2014 5:02 pm
by scottwilkerson
This is correct, however the sysperfinfo table in master contains the logfiles sized of the databases you are looking at

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Thu Apr 03, 2014 8:15 am
by detronict
That sounds logical.

However......

I try monitoring log wait using the wizard for MSSQL Database. This time I choose LoWait and see here what happens:

COMMAND: /usr/local/nagios/libexec/check_mssql_database.py -H 172.16.1.51 -U 'xxxxx' -P 'XXXXXX' -T 'msdb' -I ni01 --logwait --warning 100 --critical 300

OUTPUT: SQL Server message 208, severity 16, state 1, line 1:
Invalid object name 'sysperfinfo'.
DB-Lib error message 208, severity 16:
General SQL Server error: Check messages from the SQL Server


Is the check_mssql_database.py no working, or am i doing something wrong.

It is kind of frustrating. Am i the only one with this problem? Is anyone using this function?

Please enlighten me!!!

Regards,

detronict
Rik Lijkendijk

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Thu Apr 03, 2014 3:07 pm
by slansing
Can you run this manually, filling out the blanked out portions, from your XI server's command line:

Code: Select all

/usr/local/nagios/libexec/check_mssql_database.py -H 172.16.1.51 -U 'xxxxx' -P 'XXXXXX' -T 'msdb' -I ni01 --logwait --warning 100 --critical 300
What is the output? It is likely to be the same, but it's good to double check. What version of mssql on what version of windows are you running this against?

Also, I'm moving this to the XI general support section as it does not pertain to plugin development directly.

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Fri Apr 04, 2014 1:00 am
by detronict
The result is the same from commandline.
Both server OS and MSSQL versions are 2008R2

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Fri Apr 04, 2014 12:01 pm
by tmcdonald
Can you try running the check and then post the last 20 or so lines from the log file? Be sure to censor any sensitive information.

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Mon Apr 07, 2014 8:31 am
by detronict
Which log do you mean?

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Mon Apr 07, 2014 11:18 am
by tmcdonald

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Tue Apr 08, 2014 3:11 am
by detronict
Not much success there!!
The error is not written to the errorlog.

What i did :

- recycled errorlog so that i started with a clean errorlog.
- To be sure that the errorlog was accessable i did three executions of the command:
- first with wrong password
- second with right password
- third with wrong password again.
[root@arlnij-rhn01 ~]# /usr/local/nagios/libexec/check_mssql_database.py -H 172.16.1.51 -U 'XXXXX' -P 'XXXXX' -T 'databaseX' -I ni01 --logwait --warning 100 --critical 300
SQL Server message 18456, severity 14, state 1, line 1:
Login failed for user 'nagios'.
DB-Lib error message 18456, severity 14:
General SQL Server error: Check messages from the SQL Server
DB-Lib error message 20002, severity 9:
Adaptive Server connection failed

[root@arlnij-rhn01 ~]# /usr/local/nagios/libexec/check_mssql_database.py -H 172.16.1.51 -U 'XXXXX' -P 'XXXXX' -T 'databaseX' -I ni01 --logwait --warning 100 --critical 300
SQL Server message 208, severity 16, state 1, line 1:
Invalid object name 'sysperfinfo'.
DB-Lib error message 208, severity 16:
General SQL Server error: Check messages from the SQL Server

[root@arlnij-rhn01 ~]# /usr/local/nagios/libexec/check_mssql_database.py -H 172.16.1.51 -U 'XXXXX' -P 'XXXXX' -T 'databaseX' -I ni01 --logwait --warning 100 --critical 300
SQL Server message 18456, severity 14, state 1, line 1:
Login failed for user 'nagios'.
DB-Lib error message 18456, severity 14:
General SQL Server error: Check messages from the SQL Server
DB-Lib error message 20002, severity 9:
Adaptive Server connection failed

This resulted in the errorlog writing only the first and the last attempt!!
2014-04-08 09:44:29.00 spid56 Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64)
Jun 28 2012 08:36:30
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

2014-04-08 09:44:29.00 spid56 (c) Microsoft Corporation.
2014-04-08 09:44:29.00 spid56 All rights reserved.
2014-04-08 09:44:29.00 spid56 Server process ID is 1336.
2014-04-08 09:44:29.00 spid56 System Manufacturer: 'VMware, Inc.', System Model: 'VMware Virtual Platform'.
2014-04-08 09:44:29.01 spid56 Authentication mode is MIXED.
2014-04-08 09:44:29.01 spid56 Logging SQL Server messages in file 'K:\MSSQL10_50.NI01\MSSQL\Log\ERRORLOG'.
2014-04-08 09:44:29.01 spid56 The error log has been reinitialized. See the previous log for older entries.
2014-04-08 09:50:51.51 Logon Error: 18456, Severity: 14, State: 8.
2014-04-08 09:50:51.51 Logon Login failed for user 'nagios'. Reason: Password did not match that for the login provided. [CLIENT: 172.16.118.75]
2014-04-08 09:51:36.39 Logon Error: 18456, Severity: 14, State: 8.
2014-04-08 09:51:36.39 Logon Login failed for user 'nagios'. Reason: Password did not match that for the login provided. [CLIENT: 172.16.118.75]
Apperently MSSQL does'nt know what to fo with the error!!

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Posted: Tue Apr 08, 2014 10:57 am
by abrist
Couple of thoughts:
1) Your db user needs to have rights to the master table.
2) You may need to remove the table "-T" from the command as tables other than "master" will not include "sysperfinfo".