Ad Widget

Collapse

sql server monitoring via zabbix proxy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eric25
    Junior Member
    • Nov 2020
    • 16

    #1

    sql server monitoring via zabbix proxy

    Hi.
    I have one main zabbix server that monitors several servers. If I connect directly to the agent, MS SQL Server monitoring returns correct data. If I connect to the agent via a proxy, I get information that the TC port is available but I cannot access the database.
    My odbcinst.ini file:
    [MSSQL17]
    Description = MSSQL Driver
    Driver = / opt / microsoft / msodbcsql17 / lib64 / libmsodbcsql-17.6.so.1.1
    UsageCount = 1

    My odbc.ini file:
    [MSSQLDSN]
    Description = MS SQL conf file
    Driver = MSSQL17
    Server = <my server's IP 1>
    User = zabbix
    Password = zabbix

    [MSSQLDSN2]
    Description = MS SQL conf file
    Driver = MSSQL17
    Server = <my server 2's IP>
    User = zabbix
    Password = zabbix

    Host 1 has an MSSQL by ODBC template with macros:
    {$ MSSQL.DSN} with the value of MSSQLDSN
    {$ MSSQL.INSTANCE} with the value of MSSQL $ MSSQLSERVER
    {$ MSSQL.PASSWORD} with zabbix value
    {$ MSSQL.USER} with zabbix value
    and
    Host 2 has an MSSQL by ODBC template with macros:
    {$ MSSQL.DSN} with the value of MSSQLDSN2
    {$ MSSQL.INSTANCE} with the value of MSSQL $ SQLEXPRESS
    {$ MSSQL.PASSWORD} with zabbix value
    {$ MSSQL.USER} with zabbix value

    Host 1 monitored via proxy returns only TCP status (positive) and host 2 monitored directly without proxy returns all data. Where is the error? both zabbix users have permission to read statistics and have sysadmin role
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Have you configured ODBC on the proxy to connect to MSSQL?
    Configure it like the server and check the connection from the command line from the proxy.

    Comment

    • Eric25
      Junior Member
      • Nov 2020
      • 16

      #3
      yes it was. I didn't have the odbc proxy driver installed. Thank you very much. The question now is why is it only returning me TCP version, uptime and status?

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        First of all, you have different versions of SQL - they may have different connection settings.
        Look at the status of unsupported items - what their error message is?
        Also check the zabbix server and proxy logs.

        Comment

        • Eric25
          Junior Member
          • Nov 2020
          • 16

          #5
          I found items of the given template and most of them return not supported. Examples of errors:
          Preprocessing failed for: [{"object_name": "MSSQL $ MSSQLSERVER", "counter_name": "Uptime", "instance_name": "", "cntr_value": "9593 ...
          1. Failed: cannot extract value from json by path "$ [? (@. Object_name == 'MSSQL $ MSSQLSERVER: SQL Statistics' && @ .counter_name == 'Auto-Param Attempts / sec')]. Cntr_value.first ( ) ": no data matches the specified path
          /////
          Preprocessing failed for: [{"object_name": "MSSQL $ MSSQLSERVER", "counter_name": "Uptime", "instance_name": "", "cntr_value": "9593 ...
          1. Failed: cannot extract value from json by path "$ [? (@. Object_name == 'MSSQL $ MSSQLSERVER: Latches' && @ .counter_name == 'Latch Waits / sec')]. Cntr_value.first ()": no data matches the specified path

          in the proxy logs I did not find anything except the message that it is impossible to get the checklist and normal logs of using a proxy


          @@@@EDIT:
          I used this guide: https://support.zabbix.com/projects/...=allopenissues and then changed the {$ MSSQL.INSTANCE} macro to the SQLServer value and then the data was downloaded. The question is, if the server I observe is a replication server, will the data be different than if it were the main server?
          @@@EDIT 2:
          In the second monitored ms sql server I did not change the sql instance of the server and the agent started collecting data.
          Last edited by Eric25; 03-12-2020, 12:39.

          Comment

          • Hamardaban
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • May 2019
            • 2713

            #6
            The question is, if the server I observe is a replication server, will the data be different than if it were the main server
            - it depends on what data we are talking about! there are times when the replica is not equal to the original.

            In the second monitored ms sql server I did not change the sql instance of the server and the agent started collecting data
            - this is because different versions of MS SQL have different instance names and connection protocol settings.

            Comment

            • Eric25
              Junior Member
              • Nov 2020
              • 16

              #7
              both servers are MSSQLSERVER instances. The assumptions these servers are in a cluster, it is probably hence this variation in the displayed data.
              The server returns data so I think the topic is solved. I am aware to check for template errors if necessary. Thanks again for your help

              Comment

              Working...