Skip to content

SSH to remote host not working #5635

@Anz14

Description

@Anz14

I have stackstorm configured in Ubuntu VM. And I'm integrating stackstorm with alert-manager for auto remediation. When the alert triggers it matches the rule and trigger the action given. So my action is trying to login to the remote host which is triggering the alert and perform some actions. However SSH to remote host is not working. What needs to be done here to get the SSH working.

I'm getting the below error while executing the action.

stderr': '05/02/2022 08:37:45 AM Executing the script\n05/02/2022 08:37:45 AM Trying to ssh on host <IP ADDRESS>\nTraceback (most recent call last):\n File "/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py", line 395, in \n obj.run()\n File "/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py", line 214, in run\n output = action.run(**self._parameters)\n File "/opt/stackstorm/packs/demo/actions/kafka_demo_disk_action.py", line 44, in run\n status, output = ssh_connect(host)\n File "/opt/stackstorm/packs/demo/actions/kafka_demo_disk_action.py", line 62, in ssh_connect\n k = paramiko.RSAKey.from_private_key_file("/home/ubuntu/.ssh/stackstorm-admin-kafka.pem")\n File "/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/pkey.py", line 235, in from_private_key_file\n key = cls(filename=filename, password=password)\n File "/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/rsakey.py", line 55, in init\n self._from_private_key_file(filename, password)\n File "/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/rsakey.py", line 175, in _from_private_key_file\n data = self._read_private_key_file("RSA", filename, password)\n File "/opt/stackstorm/st2/lib/python3.8/site-packages/paramiko/pkey.py", line 307, in _read_private_key_file\n with open(filename, "r") as f:\nFileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/.ssh/stackstorm-admin-kafka.pem'\n', 'exit_code': 1, 'result': 'None'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions