Issue
Any help in this issue is appreciated! With ref to Datadog document for ssh integration I am trying to use it but getting the following error :
Datadog’s ssh_check integration is reporting: Instance #ssh_check:fbecff0ac9464f00[ERROR]: [{"message": "Server 'localhost' not found in
known_hosts", "traceback": "Traceback (most recent call last):\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/base.py\",
line 841, in run\n self.check(instance)\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/ssh_check/ssh_check.py\",
line 67, in check\n client.connect(\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/paramiko/client.py\", line 415, in connect\n self._policy.missing_host_key(\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/paramiko/client.py\", line 823, in missing_host_key\n raise
SSHException(\nparamiko.ssh_exception.SSHException: Server 'localhost' not found in known_hosts\n"}]
As per my understanding of this error: Server 'localhost' not found in known_hosts, I tried ssh myusername@localhost
and Permanently added localhost to the list of known hosts.
I am still getting the same error. So please could someone help me to fix this issue.
Any help or pointers is appricatied.
Note1: I am trying to implement an ssh check, in Datadog for my AWS ec2 instance ie I want to alert when there is an ssh issue on my servers
Solution
Found the solution. Added following line to config
add_missing_keys: true
Answered By - Ashish Karpe Answer Checked By - Mildred Charles (WPSolving Admin)