Ad Widget

Collapse

Problem: MSSQL: Failed to fetch info data (or no data for 30m)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PiotrJ
    Junior Member
    • May 2023
    • 26

    #1

    Problem: MSSQL: Failed to fetch info data (or no data for 30m)

    Hello I get this problem when host try connect with MSSQL Database
    Here is some screenshots with my settings.
    Attached Files
  • PeterZielony
    Senior Member
    • Nov 2022
    • 146

    #2
    For MSSQL username and password cannot be stored in odbc.ini and will be passed as arguments when using dsn name from zabbix frontend.

    Also Microsoft Sql server dont use directive "port="

    It should be after comma like this:
    Server = ipaddress,1433

    Also you need:

    Encrypt = yes
    Last edited by PeterZielony; 21-09-2023, 21:24.

    Hiring in the UK? Drop a message

    Comment

    • PiotrJ
      Junior Member
      • May 2023
      • 26

      #3
      I do it and odbc.ini look that, but still i have te "information"Click image for larger version

Name:	Zrzut ekranu 2023-09-21 220133.png
Views:	1127
Size:	13.7 KB
ID:	470852

      Comment

      • PeterZielony
        Senior Member
        • Nov 2022
        • 146

        #4

        Originally posted by PiotrJ
        I do it and odbc.ini look that, but still i have te "information"Click image for larger version  Name:	Zrzut ekranu 2023-09-21 220133.png Views:	4 Size:	13.7 KB ID:	470852
        Also, delete driver path from odbc.ini

        Driver above it is correct (commented out) and its name is referencing to odbcinst.ini


        Example
        odbc.ini:
        [MSSQLServer]
        Driver = this is my driver

        and odbcinst.ini:
        [this is my driver]
        Driver = /opt..<path to driver>


        On top of it check permissions is zabbix can execute odbc commands on the driver.


        And make sure your have StartODBCPollers​ at least set to 1 in for zabbix (or ZBX_STARTODBCPOLLERS=1 if in docker as environment vars). Its disabled by default​
        Last edited by PeterZielony; 22-09-2023, 06:29.

        Hiring in the UK? Drop a message

        Comment

        • PiotrJ
          Junior Member
          • May 2023
          • 26

          #5
          How can I check permissions for zabbix?
          And I install zabbix by docker compose.
          Last edited by PiotrJ; 22-09-2023, 07:37.

          Comment

          • PeterZielony
            Senior Member
            • Nov 2022
            • 146

            #6
            Originally posted by PiotrJ
            How can I check permissions for zabbix?
            And I install zabbix by docker compose.
            Ls -l

            Google permission in linux..remember this is docker


            I guess you installed odbc inside docker not on host os?

            edit. This sounds like lab so set it to 777 (driver itself) and try again.
            Last edited by PeterZielony; 22-09-2023, 08:24.

            Hiring in the UK? Drop a message

            Comment

            • PiotrJ
              Junior Member
              • May 2023
              • 26

              #7
              Ok I set 777 on file odbc.ini and yes odbc is installed inside marked container(on screenshot) in docker. And still without changes..
              Click image for larger version

Name:	Zrzut ekranu 2023-09-22 091633.png
Views:	1113
Size:	6.6 KB
ID:	470872Click image for larger version

Name:	Zrzut ekranu 2023-09-22 091851.png
Views:	1106
Size:	30.0 KB
ID:	470873​​

              Comment

              • PeterZielony
                Senior Member
                • Nov 2022
                • 146

                #8
                ok i checked my test env this is how my odbc.ini looks like
                [DSN]
                Driver = ODBC Driver 18 for SQL Server
                DSN = DSN
                Server = TCP:<ip_address>, 1433
                Port = 1433
                TrustServerCertificate = yes
                Encrypt = false

                odbcinst.ini:
                [ODBC Driver 18 for SQL Server]
                Description=Microsoft ODBC Driver 18 for SQL Server
                Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.1.so.1.1
                UsageCount=999


                regarding permissions check this file path (change to yours) not odbc.ini file permission:
                /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.1.so.1.1


                also not sure if this is supposed to be installed on web container. I don't use it from zabbix server just from proxy. In proxy we have only 2x containers : main proxy and db. And I have installed it on main proxy "engine" but for the server .... I'm not sure.

                When using on frontend create new item "database monitor" fill usr/psw even manually
                and try simple select - does it work at all?

                Also check logs on SQL itself to see if it "trying" at least to connect - if it reaching but failed login - then user permission. If there is nothing .. then to be honest i don't know.
                Last edited by PeterZielony; 22-09-2023, 10:51.

                Hiring in the UK? Drop a message

                Comment

                • PiotrJ
                  Junior Member
                  • May 2023
                  • 26

                  #9
                  When I look in item default created by mssql template i see this error
                  Attached Files

                  Comment

                  • PeterZielony
                    Senior Member
                    • Nov 2022
                    • 146

                    #10
                    Originally posted by PiotrJ
                    When I look in item default created by mssql template i see this error
                    that means it cannot find DSN entry. or driver attached to it. so maybe it has to be installed on docker where zabbix is not web container. but I never did on server - I always used proxy to query SQL


                    Hiring in the UK? Drop a message

                    Comment

                    • PiotrJ
                      Junior Member
                      • May 2023
                      • 26

                      #11
                      Its able to do it by proxy in my case?

                      Comment


                      • PeterZielony
                        PeterZielony commented
                        Editing a comment
                        it's up to you. it should work on server too - but I'm not sure if there is something wrong with configuration .. or simply wrong container.

                        All db connections i do are through proxy. I have a production network and didn't want to make odbc over net
                        Last edited by PeterZielony; 22-09-2023, 16:59.
                    • PiotrJ
                      Junior Member
                      • May 2023
                      • 26

                      #12
                      Ok I get it.
                      I had install odbc driver in container "zabbix/zabbix-server..."
                      And its work.
                      Thanks PeterZielony for help
                      Last edited by PiotrJ; 22-09-2023, 19:18.

                      Comment

                      • dimir
                        Zabbix developer
                        • Apr 2011
                        • 1080

                        #13
                        FYI. The work has started on Agent 2 plugin for MS SQL monitoring without ODBC, planned for 7.0: https://support.zabbix.com/browse/ZBXNEXT-6235

                        Comment

                        Working...