Monitor database query

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitor database query

Post by tgriep »

What version of MSSQL are you running on the your server?

Newer versions of MSSQL do not have the sys.sysperfinfo table from what I heard so that is why it is failing for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Monitor database query

Post by Naveed »

Microsoft SQL Server 2014 - 12.0.4213.0 (X64)
Jun 9 2015 12:06:16
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

check_xi_mssql_query!--username Udbread --password "u!Dutch2016." --database master --port 1433 --query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo" --result "Expected result" --decode --warning 50 --critical 200 --querywarning 50 --querycritical 200
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitor database query

Post by tgriep »

That table was removed after MSSQL 2008 so that query will not work for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Monitor database query

Post by Naveed »

Kindly just validate it what I understand from all this.

Nagios XI does not support to monitor database query in MSSQL 2014 version.

Thank you!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitor database query

Post by rkennedy »

No. The table 'sys.sysperfinfo' was removed from every version after MSSQL 2008, not monitoring completely.
Former Nagios Employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitor database query

Post by lmiltchev »

Most probably the plugin needs to be upgraded/patched. Unfortunately we don't have MSSQL 2014 server to test this in house. I found a post, explaining that the "sys.sysperfinfo" has been replaced with "sys.dm_os_performance_counters".

http://www.jasonstrate.com/2012/11/lost ... sperfinfo/

I am not sure if this is going to work - this is an old post, but you could try changing this:

Code: Select all

--query "SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo"
to this:

Code: Select all

--query "SELECT+COUNT%28%2A%29+FROM+sys.dm_os_performance_counters"
to see if this is going to fix the issue. Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Monitor database query

Post by Naveed »

Hello,

I was away, thats why could not respond it timely.

I am still having error message on it.

Database query is as follows:

check_xi_mssql_query!--username abcd --password "u!1234" --database master --port 1433 --query "SELECT+COUNT%28%2A%29+FROM+sys.dm_os_performance_counters" --result "Expected result" --decode --warning 50 --critical 200 --querywarning 50 --querycritical 200
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitor database query

Post by rkennedy »

If that is not working either, then it is most likely deprecated. I would speak with your MSSQL administrator to confirm the query works on that end, before attempting it on XI.
Former Nagios Employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitor database query

Post by lmiltchev »

In addition to this, can you check if you have an "extra" double quote somewhere? Mismatching quotes can produce these type of errors. Example:

Code: Select all

[root@localhost tmp]# cat test.sh
#!/bin/bash
echo "test"
[root@localhost tmp]# ./test.sh
test
[root@localhost tmp]# cat test.sh
#!/bin/bash
echo "test""
[root@localhost tmp]# ./test.sh
./test.sh: line 2: unexpected EOF while looking for matching `"'
./test.sh: line 3: syntax error: unexpected end of file
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked