Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Cannot figure out web service DCI

Cannot figure out web service DCI

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 19.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    J
    jds
    wrote on last edited by
    #1

    Hello all,

    We are trying to create a DCI that will read an Rest API json response for a value. We set up a web definition called "Test" with the api url, we added the authorization token and application/json headers. I set up the DCI according to the admin guide with "Test:/cellularBandwidth/values/total_usage" but the DCI returns <ERROR>. Here is an example of the json response:

    {"cellularRssi":{"unit":"dBm","values":[{"name":"AT\u0026T","data":[{"timestamp":1616719359000,"value":"-27.0"},{"timestamp":1616721157000,"value":"-55.0"},{"timestamp":1616722951000,"value":"-48.0"},{"timestamp":1616724761000,"value":"-36.0"},{"timestamp":1616726556000,"value":"-45.0"},{"timestamp":1616728358000,"value":"-63.0"},{"timestamp":1616730161000,"value":"-52.0"},{"timestamp":1616731961000,"value":"-68.0"},{"timestamp":1616733762000,"value":"-32.0"},{"timestamp":1616735576000,"value":"-39.0"}]}]},"cellularBandwidth":{"unit":"MB","values":[{"name":"AT\u0026T","total_usage":"42.88 MB","data":[{"timestamp":1616722200000,"value":8.62},{"timestamp":1616725800000,"value":9.51},{"timestamp":1616729400000,"value":8.98},{"timestamp":1616733000000,"value":10.82},{"timestamp":1616736600000,"value":4.94}]}]}}
    

    I think it's going to be something simple but I can't seem to find what we are doing wrong. Any help would be appreciated. Thank you!

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      Chances are that you are missing EnableWebServiceProxy=yes in config file of the agent (web services are collected via the agent that runs on the machine where the server runs, or via proxies if zoning is used).
      Also make sure that "Use text parsing..." checkbox is not set.

      You can use nxwsget utility to test, e.g.
      nxwsget 127.0.0.1 http://api.open-notify.org/astros.json number

      Ah, and there's probably the reason - json parser currently does not support arrays (the company that ordered web service functionality did not need this so it was not implemented).
      This means that you can request e.g. /cellulareRssi/unit and it should return dBm, but parts in [] are not available for parsing.

      1 Reply Last reply
      0
      • J
        J
        jds
        wrote on last edited by
        #3

        Thank you Filipp, I changed the DCI to request /cellularBandwidth/unit and it immediately pulled the value down in that field so it is the array that is stopping it. I'll go with plan b and create a powershell script that uses nxpush to import the values into the DCIs.

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        Powered by NodeBB Contributors
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups