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. Application DB Monitoring Query <<ERROR>>

Application DB Monitoring Query <<ERROR>>

Scheduled Pinned Locked Moved Support
8 Posts 2 Posters 68.7k 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.
  • D
    D
    deepb
    wrote on last edited by
    #1

    I'm using v4.5.0
    I have a query in agent configuration file which I'm polling in a DCI. It always gives <<ERROR>> output value. However, from the agent log below, I found that the query is indeed returning the intended output.

    2025.03.25 12:35:53.413 *D* [comm.cs.1          ] Message dump:
      ** 000000 | 00 41 50 00 00 00 00 28 00 00 00 E0 00 00 00 01 | .AP....(........
      ** 000010 | 00 00 00 55 07 00 00 00 00 00 00 09 71 75 65 72 | ...U........quer
      ** 000020 | 79 34 28 31 29 00 00 00                        | y4(1)...
      ** code=0x0041 (CMD_GET_PARAMETER) version=5 flags=0x0000 id=224 size=40 numFields=1
      ** 000000: [    85] UTF8-STRING "query4(1)"

    2025.03.25 12:35:53.413 *D* [comm.cs.1          ] Received message CMD_GET_PARAMETER (224)
    2025.03.25 12:35:53.413 *D* [comm.cs.1          ] Requesting metric "query4(1)"
    2025.03.25 12:35:55.015 *D* [db.query          ] Long running query: "MY SELECT QUERY" [5602 ms]
    2025.03.25 12:35:55.015 *D* [comm.cs.1          ] GetMetricValue("query4(1)"): 0 (SUCCESS) value = "88.78"
    2025.03.25 12:35:55.015 *D* [dbquery            ] H_DirectQueryConfigurable: Executing query "MY SELECT QUERY" in database "kmrcldb"
    2025.03.25 12:35:55.015 *D* [comm.cs.1          ] Sending message CMD_REQUEST_COMPLETED (ID 222; size 56; uncompressed)
    2025.03.25 12:35:55.015 *D* [comm.cs.1          ] Outgoing message dump:
      ** 000000 | 00 1D 50 00 00 00 00 38 00 00 00 DE 00 00 00 02 | ..P....8........
      ** 000010 | 00 00 00 1C 00 00 00 00 00 00 00 00 00 00 00 00 | ................
      ** 000020 | 00 00 00 15 07 00 00 00 00 00 00 05 38 38 2E 37 | ............88.7
      ** 000030 | 38 00 00 00 00 00 00 00                        | 8.......
      ** code=0x001D (CMD_REQUEST_COMPLETED) version=5 flags=0x0000 id=222 size=56 numFields=2
      ** 000000: [    28] INT32      0
      ** 000010: [    21] UTF8-STRING "88.78"

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

      What if you try to read value of that metric using nxget?

      1 Reply Last reply
      0
      • D
        D
        deepb
        wrote on last edited by
        #3

        It is giving correct output

        C:\NetXMS\bin>nxget 10.14.50.30 query4(1)
        90.7

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

          This means that something is configured incorrectly in the DCI. 
          Is Origin set correctly? Anything in transformation script?

          1 Reply Last reply
          0
          • D
            D
            deepb
            wrote on last edited by
            #5

            Origin : NetXMS Agent
            Metric : query4(1)
            There's no transformation.

            I think it has got something to do with query running time. If I simplify the select query then I do get output in the GUI.

            1 Reply Last reply
            0
            • D
              D
              deepb
              wrote on last edited by
              #6

              The Query does not run from the DCI Parameter Selection form too. But it runs and gives output from nxget.

              1 Reply Last reply
              0
              • D
                D
                deepb
                wrote on last edited by
                #7

                Solution was to increase the Agent.CommandTimeout value  ::)

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

                  In overall it's not recommended to increase Agent.CommandTimeout too much (like > then 5 seconds) because in situations when agents are slow to respond server will spend too much time waiting. 
                  If your query takes too long, you can use External metric provider - in this case command is executed in the backgound and agent caches values. https://netxms.org/documentation/adminguide/agent-management.html#externalmetricprovider

                  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