-
Notifications
You must be signed in to change notification settings - Fork 134
kdump-remote feature in hostcfgd #166
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1134,9 +1134,14 @@ class SshServer(object): | |
| class KdumpCfg(object): | ||
| def __init__(self, CfgDb): | ||
| self.config_db = CfgDb | ||
| self.kdump_defaults = { "enabled" : "false", | ||
| "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M", | ||
| "num_dumps": "3" } | ||
| self.kdump_defaults = { | ||
| "enabled": "false", | ||
| "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M", | ||
| "num_dumps": "3", | ||
| "remote": "false", # New feature: remote, default is "false" | ||
| "SSH_KEY": "<user@server>", # New feature: SSH key, default value | ||
| "SSH_PATH": "<path>" # New feature: SSH path, default value | ||
| } | ||
|
|
||
| def load(self, kdump_table): | ||
| """ | ||
|
|
@@ -1147,7 +1152,7 @@ class KdumpCfg(object): | |
| for row in self.kdump_defaults: | ||
| value = self.kdump_defaults.get(row) | ||
| if not kdump_conf.get(row): | ||
| self.config_db.mod_entry("KDUMP", "config", {row : value}) | ||
| self.config_db.mod_entry("KDUMP", "config", {row: value}) | ||
|
|
||
| def kdump_update(self, key, data): | ||
| syslog.syslog(syslog.LOG_INFO, "Kdump global configuration update") | ||
|
|
@@ -1177,6 +1182,25 @@ class KdumpCfg(object): | |
| num_dumps = data.get("num_dumps") | ||
| run_cmd(["sonic-kdump-config", "--num_dumps", num_dumps]) | ||
|
|
||
| # Remote option | ||
| remote = self.kdump_defaults["remote"] | ||
| if data.get("remote") is not None: | ||
| remote = data.get("remote") | ||
| run_cmd(["sonic-kdump-config", "--remote", remote]) | ||
|
|
||
| # SSH key | ||
| ssh_key = self.kdump_defaults["SSH_KEY"] | ||
| if data.get("SSH_KEY") is not None: | ||
| ssh_key = data.get("SSH_KEY") | ||
| run_cmd(["sonic-kdump-config", "--ssh_key", ssh_key]) | ||
|
|
||
| # SSH path | ||
| ssh_path = self.kdump_defaults["SSH_PATH"] | ||
| if data.get("SSH_PATH") is not None: | ||
| ssh_path = data.get("SSH_PATH") | ||
| run_cmd(["sonic-kdump-config", "--ssh_path", ssh_path]) | ||
|
||
|
|
||
|
|
||
| class NtpCfg(object): | ||
| """ | ||
| NtpCfg Config Daemon | ||
|
|
||
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 do we need this change?
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 change is still there, it is not removed. Added Detail for remote configs here in kdump table
