首页 > 解决方案 > Ubuntu 14.04.5 LTS:监视警报 -- 连接失败 sshd

问题描述

一夜之间,我收到了几十封Monit这样的邮件:

Connection failed Service sshd

        Date:        Thu, 24 Oct 2019 11:39:49
        Action:      restart
        Host:        my_app_production
        Description: failed protocol test [SSH] at INET[localhost:22] via TCP -- SSH: error receiving identification string -- Success


Your faithful employee,
Monit

Connection succeeded Service sshd

        Date:        Thu, 24 Oct 2019 11:41:50
        Action:      alert
        Host:        my_app_production
        Description: connection succeeded to INET[localhost:22] via TCP

Your faithful employee,
Monit

我检查了服务器 - 它已启动并正在运行。我检查了磁盘空间,并且有足够的空间。

我对 DevOps 不是很熟悉,也不确定我应该在哪里挖掘什么以及如何解决这个问题。谷歌搜索也没有真正的帮助。

有什么建议吗?

谢谢

标签: ubuntuamazon-ec2monit

解决方案


这应该是亚马逊的临时问题。我假设您无法查看或更改 AWS 上的 sshd 配置(或日志),因此我建议您软化监控规则。

只需使用容错功能:

if failed port 22
  # add this:
  for 2 times within 3 cycles
then alert

推荐阅读