This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SQL Authentication Failures

I have a bunch of SQL User Experience monitors that pull data from a database so that I can check the statistics against a threshold level.  I am seeing a lot of "Login Succeeded for user.  Connection made using Windows authentication"; however, I occasionally see "Login failed for user.  Reason: attempting to use an NT account name with SQL Server Authentication".  All of these monitors were close from an original template so the credentials are the same across the board.  Both the node and database that these run against are also the same.  When the failures occur I don't see any corresponding issues with the components.

Any idea what would be causing these failures?

Thanks in advance for any thoughts on this!

  • Since it appears that you are using Windows authentication for this SQL Server, ensure that each and every SQL User Experience Monitor you have configured in SAM to run against this node has the "Use Windows Authentication first, then SQL authentication" setting enabled.

    SQL Authentication.png

  • Note that even when you use "windows authentication first", sql authentication will be used for second attempt after first attempt with windows authentication fails for some reason. For tracking of this issue I would recommend to enable application debug logs (It can be done on application edit page under advanced settings) and try to find some difference for poll(s) when the issue occurred. Application debug logs are stored to "c:\ProgramData\Solarwinds\Logs\APM\ApplicationLogs\AppIdXX" where XX is id of application - there should be one log file generated from each poll.

  • I just ran the following query...

    SELECT T.Name, CTS.[Key], CTS.Value, CTS.ValueType

    FROM APM_ApplicationTemplate T

    JOIN APM_ComponentTemplate CT ON T.ID = CT.ApplicationTemplateID

    JOIN APM_ComponentTemplateSetting CTS ON CT.ID = CTS.ComponentTemplateID

    WHERE CTS.[Key] = 'WindowsAuthentication'


    In all cases WindowsAuthentication was set to False.  I ran the query because I literally have over 400 of these setup and I didn't want to go click on every single one to check.

  • You probably should add filtering on component type 17 ("SQL Sever User Experience Monitor" as other component types may use "WindowsAuthentication" setting for another purpose) to your query. Also you can be interested only in component templates which are currently in use (at least one existing component is derived from them). For that case the query could look like this:

    SELECT T.Name, CT.Name, CTS.[Key], CTS.Value, CTS.ValueType, ct.ComponentType

    FROM APM_ApplicationTemplate T

    JOIN APM_ComponentTemplate CT ON T.ID = CT.ApplicationTemplateID

    JOIN APM_ComponentTemplateSetting CTS ON CT.ID = CTS.ComponentTemplateID

    WHERE CTS.[Key] = 'WindowsAuthentication' AND CT.ComponentType = 17 AND CT.ID IN (SELECT DISTINCT ComponentType FROM APM_Component)

    Does this narrow down the list of templates that actually need change? Btw, this still does not solve components that may override value of this setting on application level. To get overview of such components you can use query:

    SELECT C.ApplicationID, C.Name, CS.[Value] as OverridenValue

    FROM APM_Component C

    INNER JOIN APM_ComponentSetting CS ON CS.ComponentID = C.ID AND CS.[Key] = 'WindowsAuthentication'

    WHERE C.ComponentType = 17

  • The list provided by my original query were the ones I am concerned with and none of them had the Windows Authentication set to true.  None of the applications have had anything override the template settings.

  • So to confirm I understand what you are saying, if my SQL Server uses Mixed Mode authentication and the account I am using to access SQL is a Windows account that has been configured inside SQL then I need to set that check box?

    Things are working right now, I just see those errors in the logs so I am curious what exactly it changes when I check that box?

  • Both authentication types (SQL and Windows) are tried when first of them fails to open connection during poll. By this setting you can change order. So to prevent unnecessary attempts generating warnings about "attempting to use an NT account name with SQL Server Authentication" you can check this option to enforce windows authentication to be tried as first.

  • Would there be any harm in using a SQL query to go through and set value to use Windows Authentication first?  I have over 400 and I really don't want to go and touch each one manually.

  • I'd personally recommend using multi-edit in SAM to edit the templates themselves. This should significantly reduce the amount of manual labor involved. However, provided the SQL query is executed properly you should have no issues. As always, we suggest that you backup your database and shutdown the Orion services before changing data in the Orion database via a SQL query. It's not required, but it's strongly recommended to avoid table locks etc.

  • The problem is each one of these is a different template so I still have over 400 templates that will need to be edited.  The reason for the multiple templates is that the queries used in the components are unique in each case.  We are pulling environmental data into Orion so it probably isn't the standard use case.