-
Notifications
You must be signed in to change notification settings - Fork 646
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
base: master
Are you sure you want to change the base?
kdump-Remote-SSH-Configurations #3400
Conversation
There was a problem hiding this 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.") |
There was a problem hiding this comment.
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.") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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.