Ad Widget

Collapse

Conectar Zabbix y Power bi

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • claudio.alvarez
    Junior Member
    • May 2025
    • 7

    #1

    Conectar Zabbix y Power bi

    necesito una ayuda, ya que estoy conectando zabbix con power bi siguiendo la pagina https://www.spikefishsolutions.com/p...ktop-to-zabbix sin embargo al finalizar me indica

    code -32600
    message invalid request
    data invalid parameter "/": unexpected parameter "auth".
  • Answer selected by claudio.alvarez at 15-05-2025, 16:44.
    claudio.alvarez
    Junior Member
    • May 2025
    • 7

    ya lo resolví muchas gracias por la ayuda, para lograrlo modificando el json de la siguiente manera
    let
    authToken = "token",
    url = "url",
    hostBody = "{
    ""jsonrpc"": ""2.0"",
    ""method"": ""host.get"",
    ""params"": {
    ""output"": [""hostid"", ""host"", ""host name""],
    ""selectInterfaces"": [""interfaceid"", ""ip""]
    },
    ""id"": 2
    }",
    Source = Json.Document(
    Web.Contents(
    url,
    [
    Headers = [
    #"Content-Type" = "application/json-rpc",
    Authorization = "Bearer " & authToken
    ],
    Content = Text.ToBinary(hostBody)
    ]
    )
    ),
    result = Source[result],
    // Convert the 'result' list to a table
    tableFromList = Table.FromList(result, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    // Expand the 'Column1' (which contains the records)
    expandedTable = Table.ExpandRecordColumn(tableFromList, "Column1", {"hostid", "host", "host name","interfaces"}, {"hostid", "host", "host name", "interfaces"}),
    // Expand the 'interfaces' list to a table
    expandedInterfaces = Table.ExpandListColumn(expandedTable, "interfaces"),
    #"Se expandió interfaces" = Table.ExpandRecordColumn(expandedInterfaces, "interfaces", {"interfaceid", "ip"}, {"interfaces.interfaceid", "interfaces.ip"})
    in
    #"Se expandió interfaces"

    Comment

    • mfortes
      Senior Member
      • Oct 2019
      • 415

      #2
      Que versão esta usando? não é mais necessário dar um get token, visto que você pode criar um token e vincular ao usuário que você esta usando no Power BI. Recomendo procurar um guia mais atualizado ou usar a documentação oficial de como fazer a primeira chamada com o Zabbix API


      Michael R. Fortes

      Linkedin: Mike Fortes
      Medium: mromeiro-f

      Comment

      • claudio.alvarez
        Junior Member
        • May 2025
        • 7

        #3
        Estoy usando la última versión de Zabbix 7.2.6 y siguiendo lo que dice la página https://www.spikefishsolutions.com/p...ktop-to-zabbix sin embargo me da ese error

        Comment

        • mfortes
          Senior Member
          • Oct 2019
          • 415

          #4
          `Precisa cadastrar usuario/senha URL e Token... Ai abre a documentação do Zabbix e da um get.host por exemplo... que vai funcionar

          Click image for larger version

Name:	image.png
Views:	125
Size:	40.3 KB
ID:	503009


          Michael R. Fortes

          Linkedin: Mike Fortes
          Medium: mromeiro-f

          Comment

          • claudio.alvarez
            Junior Member
            • May 2025
            • 7

            #5
            ya lo resolví muchas gracias por la ayuda, para lograrlo modificando el json de la siguiente manera
            let
            authToken = "token",
            url = "url",
            hostBody = "{
            ""jsonrpc"": ""2.0"",
            ""method"": ""host.get"",
            ""params"": {
            ""output"": [""hostid"", ""host"", ""host name""],
            ""selectInterfaces"": [""interfaceid"", ""ip""]
            },
            ""id"": 2
            }",
            Source = Json.Document(
            Web.Contents(
            url,
            [
            Headers = [
            #"Content-Type" = "application/json-rpc",
            Authorization = "Bearer " & authToken
            ],
            Content = Text.ToBinary(hostBody)
            ]
            )
            ),
            result = Source[result],
            // Convert the 'result' list to a table
            tableFromList = Table.FromList(result, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
            // Expand the 'Column1' (which contains the records)
            expandedTable = Table.ExpandRecordColumn(tableFromList, "Column1", {"hostid", "host", "host name","interfaces"}, {"hostid", "host", "host name", "interfaces"}),
            // Expand the 'interfaces' list to a table
            expandedInterfaces = Table.ExpandListColumn(expandedTable, "interfaces"),
            #"Se expandió interfaces" = Table.ExpandRecordColumn(expandedInterfaces, "interfaces", {"interfaceid", "ip"}, {"interfaces.interfaceid", "interfaces.ip"})
            in
            #"Se expandió interfaces"

            Comment

            Working...