Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kdump-Remote-SSH-Configurations #3400

Open
wants to merge 132 commits into
base: master
Choose a base branch
from

Conversation

Ghulam-Bahoo
Copy link

What I did
Added remote kdump functionality using SSH in SONiC.

How I did it
I added two new commands and two options to configure the kdump remote ssh feature.

How to verify it
Upon kernel crash, kdump will transfer the crash report files to the ssh server.

Copy link

@muhammadalihussnain muhammadalihussnain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@venkatmahalingam Please review the Code PR

config/kdump.py Outdated
current_remote_status = kdump_table.get("config", {}).get("remote", "false").lower()

if action.lower() == 'enable' and current_remote_status == 'true':
click.echo("Error: Kdump Remote Mode is already enabled.")
Copy link
Contributor

@venkatmahalingam venkatmahalingam Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This need not be error; you can just report INFO level message.

ssh_string = kdump_table.get("config", {}).get("ssh_string", None)
ssh_key = kdump_table.get("config", {}).get("ssh_key", None)
if ssh_string or ssh_key:
click.echo("Error: Remove SSH_string, SSH_key from Config DB before disabling Kdump Remote Mode.")
Copy link
Contributor

@venkatmahalingam venkatmahalingam Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should the SSH keys removed before KDUMP global disable? any dependency?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSH keys needs to be removed before disabling Kdump Remote Mode to avoid leftover values in the configuration files. If not removed, these keys will stay in the "kdump-tools" file and could cause confusion or security issues later. Clearing them ensures the configuration is accurate and clean

updated_lines.append(line)

with open(file_path, 'w') as file:
file.writelines(updated_lines)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be handled in hostcfgd?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct; this could be managed by hostcfgd for better consistency. We chose to handle it directly here for simplicity and immediate updates. we will modify the code hostcfgd to handle this and remove from utility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants