hertzbeat icon indicating copy to clipboard operation
hertzbeat copied to clipboard

[BUG] <Ubuntu Linux monitoring false positive unavailable state>

Open AbnerSC opened this issue 3 years ago • 1 comments

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

  1. hertzbeat通过docker部署,数据库为docker部署的MySQL8.0
  2. Linux Ubuntu监控使用22端口,IP使用服务器IP,未使用127.0.0.1
  3. hertzbeat报警,hertzbeat所在服务器本身状态为不可用
  4. 重启hertzbeat容器后恢复,一段时间后重现报警
  5. 通过其他服务器可以ping和telnet端口

Environment

HertzBeat version(s):1.3.0

Debug logs

60a5f0d5664a10-2023-03-13.0.log

Anything else?

No response

AbnerSC avatar Mar 13 '23 11:03 AbnerSC

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.

orangeCatDeveloper avatar Sep 27 '26 23:09 orangeCatDeveloper