Page 3 of 3
Re: Monitor database query
Posted: Tue Aug 16, 2016 2:47 pm
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.
Re: Monitor database query
Posted: Wed Aug 17, 2016 5:25 am
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
Re: Monitor database query
Posted: Wed Aug 17, 2016 1:32 pm
by tgriep
That table was removed after MSSQL 2008 so that query will not work for you.
Re: Monitor database query
Posted: Thu Aug 18, 2016 6:11 am
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!
Re: Monitor database query
Posted: Thu Aug 18, 2016 10:25 am
by rkennedy
No. The table 'sys.sysperfinfo' was removed from every version after MSSQL 2008, not monitoring completely.
Re: Monitor database query
Posted: Thu Aug 18, 2016 10:42 am
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.
Re: Monitor database query
Posted: Tue Sep 06, 2016 7:30 am
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
Re: Monitor database query
Posted: Tue Sep 06, 2016 11:39 am
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.
Re: Monitor database query
Posted: Tue Sep 06, 2016 11:51 am
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