Ad Widget

Collapse

MSSQL Plugin - errors after config (failed to get conn, create conn)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SteveA_ZVC
    Junior Member
    • Oct 2024
    • 2

    #1

    MSSQL Plugin - errors after config (failed to get conn, create conn)

    Hi,
    I'm fairly new to Zabbix and this is my first time setting up a plugin so go easy on me!

    I've been trying to setup the Zabbix MSSQL plugin on one of our servers to see what data is pulls through and if it can fulfil our monitoring requirements to then push it out to our other SQL servers but so far I've been having problems getting it to connect.

    We are running Zabbix version: 6.0.34
    Zabbix Agent 2 version is 6.4.13.2400
    Zabbix Agent 2 Plugin is 6.4.13.2400
    OS of SQL server is Windows Server 2022 and SQL version is also 2022.

    I'm seeing the below error in the Zabbix console on any of the metrics that are making a SQL connection
    Click image for larger version

Name:	image.png
Views:	1225
Size:	4.0 KB
ID:	493123

    I've enabled full logging on the Agent and am seeing the following:

    2024/10/21 17:57:14.081592 received passive check request: 'mssql.nonlocal.db.get["sqlserver://servername:1433","zabbix","correctpassword"]' from 'zabbixIP'
    2024/10/21 17:57:14.081592 [1] processing update request (1 requests)
    2024/10/21 17:57:14.081592 [1] adding new request for key: 'mssql.nonlocal.db.get["sqlserver://servername:1433","zabbix","correctpassword"]'
    2024/10/21 17:57:14.081592 [1] created direct exporter task for plugin 'MSSQL' itemid:0 key 'mssql.nonlocal.db.get["sqlserver://servername:1433","zabbix","correctpassword"]'
    2024/10/21 17:57:14.082120 executing direct exporter task for key 'mssql.nonlocal.db.get["sqlserver://servername:1433","zabbix","correctpassword"]'
    2024/10/21 17:57:14.082120 [MSSQL] plugin MSSQL executing Export Request
    2024/10/21 17:57:14.082120 [MSSQL] Creating new connection to "sqlserver://servername:1433", with user "zabbix" to database "", with CA certificate "", trust server certificate "true", host name in certificate "" encrypt "", TLS min version ""
    2024/10/21 17:57:14.089532 failed to execute direct exporter task for key 'mssql.nonlocal.db.get["sqlserver://servername:1433","zabbix","correctpassword"]' error: 'Failed to execute handler: failed to execute handler: failed to get conn: failed to create conn: failed to ping: mssql: login error: Login failed for user 'zabbix'.'
    2024/10/21 17:57:14.090065 [MSSQL] plugin MSSQL executed Export Request
    2024/10/21 17:57:14.090065 sending passive check response: ZBX_NOTSUPPORTED: 'Failed to execute handler: failed to execute handler: failed to get conn: failed to create conn: failed to ping: mssql: login error: Login failed for user 'zabbix'.' to 'zabbixIP'


    I have tried the servername as both "localhost" and the server name itself with and without domain suffix and none of these changes made any difference.

    I have confirmed the password by signing in to SSMS and also given System Admin access as a test to ensure there are no permission issues.

    Does anyone have any advice on how to resolve this?

  • zekaleka
    Junior Member
    • Jul 2024
    • 8

    #2
    facing same issue. Maybe someone knows the solution or troubnleshooting steps which can help?

    Comment

    • PCalcina
      Junior Member
      • Oct 2023
      • 13

      #3
      Hello All.
      I hace the same error, any recommentation?

      Regards.
      Pablo

      Comment

      • PCalcina
        Junior Member
        • Oct 2023
        • 13

        #4
        Hello All,
        In my case the problem (same error code) was beacouse whe use a domain user to connect via ODBC to the database and a certificate. if the user get locked you receibe a certificate error.
        Try checking the user status.
        after change the user to never lock the problem was fixed.
        Regards

        Comment

        • zekaleka
          Junior Member
          • Jul 2024
          • 8

          #5
          Can confirm, try to set username macro to DOMAIN/username , instead of simply username.
          In most cases it should work

          Comment

          • PCalcina
            Junior Member
            • Oct 2023
            • 13

            #6
            Macros was configured with DOMAIN/USERNAME

            Regards

            Comment

            Working...