[BUG] <Ubuntu Linux monitoring false positive unavailable state>
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
hertzbeat部署在docker中,docker所在的容器监控Linux Ubuntu报警不可用
Expected Behavior
No response
Steps To Reproduce
- hertzbeat通过docker部署,数据库为docker部署的MySQL8.0
- Linux Ubuntu监控使用22端口,IP使用服务器IP,未使用127.0.0.1
- hertzbeat报警,hertzbeat所在服务器本身状态为不可用
- 重启hertzbeat容器后恢复,一段时间后重现报警
- 通过其他服务器可以ping和telnet端口
Environment
HertzBeat version(s):1.3.0
Debug logs
60a5f0d5664a10-2023-03-13.0.log
Anything else?
No response
The attached log shows the cause: from 18:00 the one-row SSH parser threw ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 (the command returned fewer lines than configured fields), and 1.3.0 only closed the exec channel on the success path. Each failure leaked a channel on the reused session until the server's MaxSessions limit was reached, after which every collection failed with open failed (312 times from 18:09) until a restart released the session.
Both halves are fixed on current master: the one-row parser fills missing fields with empty values instead of throwing, and SshCollectImpl always closes the channel in finally (closing the session too if the channel cannot be closed). I verified it against an sshd limited to MaxSessions=3 with connection reuse on: 20 collections with 5 output lines for 6 fields all succeeded, and after 10 collections that failed after the channel was opened (command timeouts), the same reused session still ran a command successfully. Closing; please reopen if you still see open failed on the latest release.