NSClient++ Help (#1) - How NSClient handle parallel checks (#758) - Message List

How NSClient handle parallel checks

Hello,

I was wondering something about NSClient++ : I am using NSClient on some hosts, only as a nsca client. So, every 15 minutes, NSClient will have about 15 - 20 checks to execute. About half are NSClient internal commands (CheckCPU...) The other half are external scripts (vbs), and are launched by "cscript.exe".

So, the thing i am wondering is : how will NSClient++ handle 10 scripts that have to be launched at the same time ? What if they are 10 different scripts ? What if they are 10 time the same script, but launched with different arguments ?

Will NSClient launch parallel execution of the scripts, or will it wait for one to end, before launching another one ?

Thanks in advance.

  • Message #2107

    In this case it will run them in parallel (if you use the NSCA thingy). But this is not a "guarantee" and in fact 0.4.x will run them concurrently (depending on the thread pool size I guess).

    So I would not design anything based on this behavior.

    Why is it important?

    Michael Medin

    • Message #2108

      Well, I wanted to be sure that a scritp that will last for, let's say, 30 seconds, or 1 minute, will not block everything else.

      But I made a test : My NSClient is configured to launch 20 NSCA commands, that will launch 20 times the same script.

      [External Scripts]
      Test_Check = cscript.exe //NoLogo scripts\check_test.vbs
      [...]
      [NSCA Commands]
      Check_0 = Test_Check
      Check_1 = Test_Check
      [...]
      

      And check_test.vbs :

      [...]
      wscript.Sleep 10000
      wscript.Echo "ok"
      wscript.quit(0)
      

      So, my script will always last for 10s. I monitored the "cscript.exe" on my laptop, and I have noticed that it will be launched 20 times, one after another, each time lasting for 10s. Is this the normal behavior ?

      • Message #2109

        Right,

        Well.. in 0.3.x this will be a problem. In 0.4.x it will (hopefully) not be.

        Michael Medin

      • Message #2110

        I guess the "work around" would be to use active checks for the long running check. (and or, run it in the background and only collect the result)

        Michael Medin

        • Message #2112

          Ok, thanks. I can't use active checks on this environment (too intrusive, open a port in Input in the firewall, etc, etc...). Only passive checks are authorized on some of my distant hosts.

          I will try to modify my checks / scripts, correct them.

          Just to let you know, one of the script that take a lot of time to run is the one that checks if windows updates are available. I took one on nagios exchange a few months ago, then I tested the one you posted a few weeks ago, and both can sometimes be so slow to run... But these scripts retrieve very good information, and I can't find another way to do the same thing.

          About the parallel checks, if I can't find a way to correct this temporarily, then I will have to wait for 0.4.x :)

Subscriptions