Ticket #338 (closed defect: fixed)

Opened 2 years ago

Last modified 8 months ago

Bug with NSCA Agent when I have a lot of services

Reported by: nunki Owned by: mickem
Priority: 1 Milestone: 0.3.9
Component: None Version: 0.3.9
Severity: Bugs Keywords:
Cc: Florian.Lindner@…

Description

I have a problem with NSClient++ using nsca agent. I have the last version. It seems that when I have a lot of service to check, not all of the result are send to the nsca server.

I have 18 services and I have the result of 12 services. My configuration is OK. When I launch NSClient++ /test, I see that all the checks are done.

In the log file of the nsca server (syslog), I have no error. But, I haven't got all the services.

So, NSClient can't send a lot of data to the nsca server or the nsca server can't receive a lot of data. Have you test the nsca agent of NSClient with a lot of services?

Thanks in advance

nb: sorry for my english...

Change History

comment:1 Changed 2 years ago by Florian

  • Cc Florian.Lindner@… added

Proposed solution:

add config option to [NSCA Agent] section: collect_results=0|1

if set to 1: no changes, keep old behavior if set to 0: new behavior: in the loop in NSCAAgent/NSCAThread.cpp starting line 190 instead of "results.push_back(result);" do a "send(results);" for each check result.

I don't have Windows development tools available, and my knowledge of windows development is very limited. Otherwise I'd submitted a patch file :-)

comment:2 Changed 2 years ago by mickem

  • Owner set to mickem

Humm, a more likely scenario I think is that the problem is due to the length of data in the message.

But a lot of people has reported this and I need to investigate. I shall see if I can track it down and fix it for the0.3.8 rel.

Michael Medin

comment:3 Changed 2 years ago by Florian

Of course it's the length of the messages.

I guess the textbook solution would be to detect when the payload of the nsca package would exceed 512 bytes before the next result were added in NSCAThread::send(), to send the almost full package and start a new package for the remaining results.

My proposed solution to send one package for each check result causes a lot of unneeded network overhead, I'm aware of that. But frankly, I'm too unfamiliar with C++ to understand your code and provide a solution how to change your code. I can only describe it with words, not with code lines and example code.

The quick'n'dirty solution to send each check result in a separate package, controlled by a config setting, would be totally OK for me. :-)

Too bad I never worked with MS VC++ before and I'm too stupid to get NSCAAgent.dll compiled to try hacking it on my own and providing a roughly tested patch.

Regards

Florian

comment:4 Changed 2 years ago by mickem

  • Version 0.3.7 deleted
  • Milestone set to 0.3.8

Haha, you don't need to be "stupid" to have trouble building on MSVC I spent hours figuring it out, It is a b*tch with all third party libraries all working differently :)

Anyways, I shall look into it this weekend so expect something (along the lines of beta) early next week.

As for the length the easy solution would be to truncate but it is not so easy: First there is an internal buffer which is slightly larger but not overly so (which is removed in next 0.4.x branch BTW) which needs to conquered somehow. Then we have the trouble that return buffer contains "message" and "performance data" message is pretty simple to just truncate but performance data cant really be truncated in a "easy" way and since the data is concatenated I would need to parse it to be able to truncate it.

But again, I shall look into it this weekend. The strange thing is there are checks for length so I don't understand why there is no message. I should not "silently" fail, but again... will check....

Michael Medin

comment:5 follow-up: ↓ 6 Changed 22 months ago by nunki

News about this ticket? I have tried the last release but the problem is the same!

Regards, Nunki

comment:6 in reply to: ↑ 5 Changed 17 months ago by gersondiesel

Replying to nunki:

News about this ticket? I have tried the last release but the problem is the same!

Regards, Nunki

Same here. More details in Ticket  http://nsclient.org/nscp/ticket/406

comment:7 Changed 17 months ago by mickem

This is beein worked upon and will hopefully be resolved in the next version. The latest nightly have some fixes but there were reports of issues (same ones) so I need to look into this more.

I have not had time last few weeks so perhaps this weekend?

Michael Medin

comment:8 Changed 8 months ago by mickem

  • Status changed from new to closed
  • Version set to 0.3.9
  • Resolution set to fixed
  • Milestone changed from 0.3.8 to 0.3.9

This is fixed...

Note: See TracTickets for help on using tickets.