centreon-nsclient-build
centreon-nsclient-build copied to clipboard
centreon_plugins.exe can hang forever
Hi,
centreon_plugins.exe
, called by NSClient++, can hang forever, accumulating processes and memory consumption on the monitored Windows machine.
Below is the faulty behaviour we discovered with an unpatched Net::NTP (see #25 and https://github.com/centreon/centreon-plugins/issues/2129). But seems to be a more general issue, as I tend to demonstrate below.
With following nsclient.ini
configuration :
[/settings/external scripts]
timeout=10
And using centreon_plugins.pl --plugin=apps::protocols::nrpe::plugin --custommode=nsclient --new-api ...
as client (should be the case with other clients too).
When launching the centreon_plugins.pl
command, we see 2 new centreon_plugins.exe
processes appearing :
![1](https://user-images.githubusercontent.com/40244829/98052047-7762dd80-1e35-11eb-8655-ab441a710eb4.png)
10 seconds later, the centreon_plugins.pl
returns with the following :
Command check_centreon_plugins didn't terminate within the timeout period 10s
Additional --debug
gives :
{"command":"check_centreon_plugins","lines":[{"message":"Command check_centreon_plugins didn't terminate within the timeout period 10s","perf":{}}],"result":3}
And on Windows side, one of the 2 processes disappears, for sure killed by NSClient++ :
![2](https://user-images.githubusercontent.com/40244829/98052140-b2651100-1e35-11eb-9ad8-adb2f2f24228.png)
Unfortunately, as you can see, the bigger one remains, and it hangs forever.
So seems like NSclient++ does its job killing the external command, perhaps there's an issue with signal handling / forwarding in centreon_plugins.exe
itself.
Even with a dummy sleep
in the plugin's code as a really simple test case, the second process does not get killed.
Thx 👍