Ad Widget

Collapse

Template MSSQL and FAILED cannot extract value from json by path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sysadm.es
    Junior Member
    • May 2020
    • 21

    #1

    Template MSSQL and FAILED cannot extract value from json by path

    Greetings.

    I'm using this official template with zabbix version 5.0.4




    After configure the ODBC connection and verify is working fine, auto discovery can retrieve databases but each value

    Preprocessing failed for: [{"object_name":"MSSQL$ISNTANCENAME","counter_na me":"Uptime","instance_name":"","cntr_value":".. .
    1. Failed: cannot extract value from json by path "$[?(@.object_name=='MSSQL$ISNTANCENAME:SQL Statistics' && @.counter_name=='Batch Requests/sec')].cntr_value.first()": no data matches the specified path

    Usually i use other kinds of template, but this one as be official template was testing. What are wrong with this? Anyone tried to work with this ?

    Found this thread in the community but didn't understand the solution given

    Attached Files
  • AVP.Riga
    Member
    • Oct 2020
    • 59

    #2
    Good day,

    Did you install ODBC drivers for zabbix? Please check /etc/odbcinst.ini and /etc/odbc.ini files. (dnf install unixODBC - if you want install them)
    Fist file must contain something like that:

    Code:
    # Driver from the freetds-libs package
    # Setup from the unixODBC package
    [FreeTDS]
    Description = Free Sybase & MS SQL Driver
    Driver = /usr/lib/libtdsodbc.so
    Setup = /usr/lib/libtdsS.so
    Driver64 = /usr/lib64/libtdsodbc.so
    Setup64 = /usr/lib64/libtdsS.so
    Port = 1433
    second one can(or not) contain:
    Code:
    [mssql01]
    Description = mssql01.test.com database
    Driver = FreeTDS
    Server = x.x.x.x

    Comment

    • sysadm.es
      Junior Member
      • May 2020
      • 21

      #3
      Originally posted by AVP.Riga
      Good day,

      Did you install ODBC drivers for zabbix? Please check /etc/odbcinst.ini and /etc/odbc.ini files. (dnf install unixODBC - if you want install them)
      Fist file must contain something like that:

      Code:
      # Driver from the freetds-libs package
      # Setup from the unixODBC package
      [FreeTDS]
      Description = Free Sybase & MS SQL Driver
      Driver = /usr/lib/libtdsodbc.so
      Setup = /usr/lib/libtdsS.so
      Driver64 = /usr/lib64/libtdsodbc.so
      Setup64 = /usr/lib64/libtdsS.so
      Port = 1433
      second one can(or not) contain:
      Code:
      [mssql01]
      Description = mssql01.test.com database
      Driver = FreeTDS
      Server = x.x.x.x
      Greetings AVP.Riga, thanks for your answer.

      it's not a problem related with the ODBC, the ODBC is running fine.

      I'm using directly the ODBC driver from Microsoft not FReeTDS.

      https://docs.microsoft.com/en-us/sql...l-server-ver15

      The connection from zabbix to the MSSQLServer through Microsoft ODBC Driver is working fine.

      The problem is related with the XML template and how retrieve the patterns through the regex.

      Comment

      • sysadm.es
        Junior Member
        • May 2020
        • 21

        #4
        I found where the problem and a workaround

        explained here:

        Comment

        Working...