Ad Widget

Collapse

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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tester777
    Junior Member
    • Aug 2020
    • 9

    #1

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

    Hi
    Been using the template for some years now on some servers.
    But on two of them it gets no connections.(error in topic name)

    I can connect to them just fine via ssms or odbc connection with the same settings (dns name, username and password) as in odbc.ini and in macro settings.
    Also i can make a "telnet dns 1433" successfully from the zabbix server.

    I have run out of ideas and really appreciate any more hints.
    Thanks
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #2
    What is your Zabbix version?

    Are you using MySQL standard template with ODBC or Agent2?
    Did you double check your host macros?

    Zabbix documents MySQL integration here.

    Comment

    • tester777
      Junior Member
      • Aug 2020
      • 9

      #3
      Hi Mark

      Zabbix 5.4.7 on Server. 5.4.3.2400 on Agent.

      I am using MSSQL, not Mysql.

      Using default 'MSSQL by ODBC' Template v5.4.
      I triple checked the host macros.

      I do not understand.

      Comment

      • markfree
        Senior Member
        • Apr 2019
        • 868

        #4
        Originally posted by tester777
        I am using MSSQL, not Mysql.
        Oh sorry about that. My mistake.

        I guess you already checked MSSQL template documentation, right...

        In the past, I had the same trigger alert and the issue was a DSN syntax error.
        After fixing that, it just worked. That was a MySQL DBMS, though.

        Another thing I would check is the template version.
        Maybe you've upgraded your system from an earlier version and your old templates remained the same.
        So, something might be a bit different, I guess.

        Comment

        • Aminam
          Junior Member
          • Nov 2020
          • 7

          #5
          try to query from your zabbix server using tools like sqlcmd to see if it works fine from there and if not attach the error.

          Comment

          • OnMe
            Junior Member
            • Apr 2022
            • 1

            #6
            The same problem by me, I was able to connect via sqlcmd, but Zabbix still had the same result. In my case, I needed to GRANT VIEW SERVER STATE TO [zabbix monitor user]

            Comment

            • orbenet
              Junior Member
              • May 2022
              • 5

              #7
              Hello,

              I had similar issue unrelated to Zabbix with MSSQL where I was basically pulling out hairs. 1433 was open but SQL connections did not work for a specific application. What I found was that on that particular deployment, SQL would switch to Dynamic Ports once it established initial connection via 1433.

              Have you checked whether this may be the issue?

              Since you have it working on some, I will assume you have read documentation for setting up the Zabbix DB User and Permissions - without understanding you infrastructure deeply - it would be hard to provide a reliable answer. The above was due to our organization deploying internal firewall that were not properly configured for that connection - and our databases using Dynamic Ports for communications.

              If you can:

              1. What version of MSSQL is running?
              2. Is it standalone, Clustered?
              3. Can you see in Zabbix_Server.log file anything related to this specific host, host_item?

              Thank you!

              Comment

              • EHRETic
                Member
                • Jan 2021
                • 45

                #8
                Originally posted by OnMe
                The same problem by me, I was able to connect via sqlcmd, but Zabbix still had the same result. In my case, I needed to GRANT VIEW SERVER STATE TO [zabbix monitor user]
                Hi there,

                Same issue and don't know how to resolve it... I tried to give sysadmin permissions but it didn't solve the problem either.

                I'll try to look at Zabbix server logs to see if I find something. The firewall idea is also a good lead...

                Comment

                • SideSh0wWilly
                  Junior Member
                  • Feb 2023
                  • 3

                  #9
                  To add to this, here is the link to the odbc drivers for the Zabbix server. Its a little tricky to install due to deprecated functions with keys but with a little linux knowledge you can get it working.


                  Comment

                  • petermilburn
                    Junior Member
                    • Jul 2022
                    • 4

                    #10
                    I am also getting the same issue with not collecting any data from the SQL server. I am able to connect to the sql via isql and run a query. I am not getting any errors about connecting. Just not receiving any data back from the database. I am running Zabbix 6.2 and mssql drivers 17 and 18

                    Comment

                    • EHRETic
                      Member
                      • Jan 2021
                      • 45

                      #11
                      Hi there,

                      I think I found the solution but people, it would be REEEEAAAALLLLYYY nice to put a proper documentation...
                      Please add to the doc's page that you HAVE TO have a valid DSN in your /etc/odbc.ini file and that you HAVE to specify that DSN in your macros, otherwise, people will look forever how to configure it!

                      Sample:
                      Code:
                      [MY-DSN-NAME]
                      Driver = /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.1.1
                      server=serverfqdn or serverip
                      TrustServerCertificate=yes
                      This is the driver I use, please update the first line, last line is to ignore the certificate if self-signed.

                      And if anybody has some tips for that file, don't hesitate to share! Thx
                      Last edited by EHRETic; 27-03-2023, 18:33.

                      Comment

                      • cyber
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Dec 2006
                        • 4807

                        #12
                        Looks like it is all here.. https://www.zabbix.com/documentation...es/odbc_checks

                        Comment

                        • EHRETic
                          Member
                          • Jan 2021
                          • 45

                          #13
                          Originally posted by cyber
                          Yes, but it is still missing an information that you have to configure those things in the MSSQL integration page.
                          This would be really great to know whenever trying to configure it.

                          Current info:

                          Click image for larger version

Name:	image.png
Views:	6784
Size:	119.0 KB
ID:	461959

                          Comment

                          • cyber
                            Senior Member
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Dec 2006
                            • 4807

                            #14
                            Well, I would say, that you leave half of documentation unread and complain that the half you did read, did not contain everything.. But ok ..let it be...

                            Just leaving some qutes from that page:

                            Although dsn and connection string are optional parameters, at least one of them should be present. If both data source name (DSN) and connection string are defined, the DSN will be ignored.
                            The data source name, if used, must be set as specified in odbc.ini.
                            The connection string may contain driver-specific arguments.

                            Comment

                            • EHRETic
                              Member
                              • Jan 2021
                              • 45

                              #15
                              Originally posted by cyber
                              Well, I would say, that you leave half of documentation unread and complain that the half you did read, did not contain everything.. But ok ..let it be...

                              Well, I think we are not speaking of the same page... this is the one I captured the setup mentionned above: https://www.zabbix.com/integrations/mssql

                              And YES, it is really difficult to create the connection between the 2 pages when you first land on the integration page.

                              Comment

                              Working...