Unable to query SQL Server 2016 using dbquery.nsm
-
Hi,
I try to query some data from an MS SQL Server 2016, but can't get it working.
My Agent config (xxx means confidential):
MasterServers = xxx
ConfigIncludeDir = D:\Program Files\NetXMSAgent\etc\nxagentd.conf.d
LogFile = D:\Program Files\NetXMS\log\agent.log
DebugLevel = 4
FileStore = D:\Program Files\NetXMSAgent\var
SubAgent = filemgr.nsm
SubAgent = ping.nsm
SubAgent = logwatch.nsm
SubAgent = winperf.nsm
SubAgent = wmi.nsm
SubAgent = dbquery.nsmExecTimeout=60000
ExternalParameterShellExec=Custom.EBGroupUsers:net localgroup "Engineering Base" | find /c "\"*DBQUERY
Database = id=db1;driver=mssql.ddr;server=xxx(IP ADDRESS);dbname=master;login=xxx;password=xxx
Query = SQL.RecoverModel:db1:600:SELECT Count(name) FROM sys.databases WHERE recovery_model<>3 and name not in ('msdb','model','master')I'm sure username and password works.
In the agent log I get:
DBQUERY: cannot connect to database db1 ([Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2]. )
DBQUERY: H_DirectQueryConfigurable: no connection handle for database db1Named Pipes and TCP/IP is enabled in configuration manager.
I use NetXMS Version 3.2.380
Best regards
Stefan
-
Hi,
configuration looks good. Is hybrid authentication enabled? Also, could it be that password contains some characters that could be misinterpreted (like: ; # ' ")?
Best regards,
Victor -
Hi,
I think You mean "Mixed Mode Authentication" in SQL Server? This is enabled. Password only uses upper and lowercase chars with some numbers.
Checking the SQL server logs shows that there is no try to login from the login used by the agent.
Very strange.Do You have more ideas?
Regards
Stefan
-
Hi,
I did some testing on my system, and I can get this error if TCP/IP is disabled in native client configuration. Check "Client Protocols" section under "SQL Native Client 11.0 Configuration" in "SQL Server Configuration Manager".
Best regards,
Victor -
-
-
-
-
Thanks for the follow up
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
