Application DB Monitoring Query <<ERROR>>
-
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" -
What if you try to read value of that metric using nxget?
-
-
This means that something is configured incorrectly in the DCI.
Is Origin set correctly? Anything in transformation script? -
-
-
-
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
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