Page 1 of 1
Unable to execute SQL query (with confirmed access)
Posted: Fri Jun 12, 2020 4:22 pm
by dlukinski
Hello XI support
We've tried configuring this query for monitoring (SQL Query Wizard):
Code: Select all
SELECT DATEDIFF(MINUTE,start_time,GETDATE())
FROM sys.dm_cdc_log_scan_sessions
WHERE session_id = (SELECT MAX(b.session_id) FROM sys.dm_cdc_log_scan_sessions AS b);
GO
It is configured against the known instance and DB (many other operational queries), but we get the error message:
- CRITICAL: Could not execute the Query.
Re: Unable to execute SQL query (with confirmed access)
Posted: Mon Jun 15, 2020 4:02 pm
by cdienger
Edit the service in the CCM and use the "Run Check Command" to get the full command. Try running the command both here as well as from the command line. Swith to the nagios user before running it from the command line:
Please provide a screenshot showing the full command and results on the command line.
Re: Unable to execute SQL query (with confirmed access)
Posted: Tue Jun 16, 2020 1:14 pm
by dlukinski
cdienger wrote:Edit the service in the CCM and use the "Run Check Command" to get the full command. Try running the command both here as well as from the command line. Swith to the nagios user before running it from the command line:
Please provide a screenshot showing the full command and results on the command line.
Same problem (while we could execute same query from SQL managwr with same permissions used)
Code: Select all
[[email protected] ~]$ /usr/local/nagios/libexec/check_mssql -H 10.102.74.196 --username "nagiosxi" --password "checkNAG1" --database Siebeldb --port 1435 --query "SELECT+DATEDIFF%28MINUTE%2Cstart_time%2CGETDATE%28%29%29%0D%0AFROM+sys.dm_cdc_log_scan_sessions++%0D%0AWHERE+session_id+%3D+%28SELECT+MAX%28b.session_id%29+FROM+sys.dm_cdc_log_scan_sessions+AS+b%29%3B++%0D%0AGO++%0D%0A" --decode --warning 50 --critical 200 --querywarning 10 --querycritical 15 --result "Expected result"
CRITICAL: Could not execute the Query.
Re: Unable to execute SQL query (with confirmed access)
Posted: Tue Jun 16, 2020 1:20 pm
by cdienger
A ticket has been opened for this. Locking thread.
Re: Unable to execute SQL query (with confirmed access)
Posted: Tue Jun 30, 2020 6:40 am
by dlukinski
This was resolved in the ticket, please close the thread
Re: Unable to execute SQL query (with confirmed access)
Posted: Tue Jun 30, 2020 8:09 am
by scottwilkerson
dlukinski wrote:This was resolved in the ticket, please close the thread
Great!
Locking thread