Hello,
We're having issues with a MSSQL query check that works on a older version of Nagios XI (5.4.13) but not on a newer Nagios XI version (5.6.7). Here are examples of the query issues we're having. You can see the query works fine on v5.4.13. But not on v5.6.7 Can someone assist me with this?
--username ***** --password ***** --database ***** --query "declare @t table (Result VARCHAR(10)) INSERT INTO @t EXEC DBA_NumJobsFailed 540 SELECT CASE WHEN Result > 0 THEN 'True' ELSE 'False' end FROM @t" --result "False" --decode --warning 50 --critical 200
Old Nagios XI Result (5.4.13)
/usr/local/nagios/libexec/check_mssql -H ***** --username ***** --password ***** --database ***** --query " declare @t table (Result VARCHAR(10)) INSERT INTO @t EXEC DBA_NumJobsFailed 540 SELECT CASE WHEN Result > 0 THEN 'True' ELSE 'False' end FROM @t" --result "False" --decode --warning 50 --critical 200
OK: Query results matched, query duration=0.021611 seconds.|query_duration=0.021611s;50;200
Newer Nagios XI Result (5.6.7)
/usr/local/nagios/libexec/check_mssql -H ***** --username ***** --password ***** --database ***** --query "declare @t table (Result VARCHAR(10)) INSERT INTO @t EXEC DBA_NumJobsFailed 540 SELECT CASE WHEN Result > 0 THEN 'True' ELSE 'False' end FROM @t" --result "False" --decode --warning 50 --critical 200
CRITICAL: Query expected "False" but got "".|query_duration=0.008701s;50;200 ''=;
MSSQL Query Issue
Re: MSSQL Query Issue
What version of check_mssql is on both machines? Check by running "/usr/local/nagios/libexec/check_mssql -V"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: MSSQL Query Issue
In addition to the previous post, there is a configuration file that the plugin uses when connecting to MSSQL servers.
Check this file on the old server and add the changes to the new server and see if that resolves the issue.
Check this file on the old server and add the changes to the new server and see if that resolves the issue.
Code: Select all
/etc/freetds.confBe sure to check out our Knowledgebase for helpful articles and solutions!