Wizard MSSQL Database (monitoring LogFileUsage)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
detronict
Posts: 24
Joined: Mon Mar 31, 2014 5:13 am

Wizard MSSQL Database (monitoring LogFileUsage)

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post by scottwilkerson »

This is correct, however the sysperfinfo table in master contains the logfiles sized of the databases you are looking at
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
detronict
Posts: 24
Joined: Mon Mar 31, 2014 5:13 am

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post 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.
detronict
Posts: 24
Joined: Mon Mar 31, 2014 5:13 am

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post by detronict »

The result is the same from commandline.
Both server OS and MSSQL versions are 2008R2
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post 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.
Former Nagios employee
detronict
Posts: 24
Joined: Mon Mar 31, 2014 5:13 am

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post by detronict »

Which log do you mean?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post by tmcdonald »

Former Nagios employee
detronict
Posts: 24
Joined: Mon Mar 31, 2014 5:13 am

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post 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!!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Wizard MSSQL Database (monitoring LogFileUsage)

Post 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".
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked