Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
125f4d0
Fixes to configbuilder and typeutils
amd-keonlee2 May 29, 2026
d05d58c
PciePlugin enhancement
alexandraBara Jun 8, 2026
5307860
enhanced var/log/messages collection
alexandraBara Jun 8, 2026
55a1e2f
new oobdata plugin with ssh
alexandraBara Jun 8, 2026
09449a2
adding ability to specify multiple collectors
alexandraBara Jun 8, 2026
87acdb2
new oobdata plugin with ssh
alexandraBara Jun 8, 2026
8f3b278
Merge remote-tracking branch 'origin/development' into config_builder…
amd-keonlee2 Jun 8, 2026
2f394fb
Merge pull request #211 from amd/alex_pcie_update
alexandraBara Jun 8, 2026
42db71c
docs: Update plugin documentation [automated]
github-actions[bot] Jun 9, 2026
4a1be80
Merge pull request #214 from amd/automated-plugin-docs-update
alexandraBara Jun 9, 2026
d3cdd5e
removed ifoe plugin
alexandraBara Jun 9, 2026
1e41579
Merge branch 'development' into alex_syslog
alexandraBara Jun 9, 2026
2b8ca45
generic collection plugin
alexandraBara Jun 9, 2026
22d7247
Merge branch 'development' into alex_oob_ssh
alexandraBara Jun 9, 2026
df1483b
Merge pull request #213 from amd/alex_syslog
alexandraBara Jun 9, 2026
d8af0fa
generic plugin
alexandraBara Jun 9, 2026
de04d5c
Merge branch 'development' into alex_oob_ssh
alexandraBara Jun 9, 2026
1429556
Merge branch 'development' into alex_ifoe_ns
alexandraBara Jun 9, 2026
3def9f4
Merge branch 'development' into alex_generic_collection
alexandraBara Jun 9, 2026
b680e96
Merge pull request #212 from amd/alex_oob_ssh
alexandraBara Jun 9, 2026
b4f3e68
Merge branch 'development' into alex_ifoe_ns
alexandraBara Jun 9, 2026
fae0c70
Merge branch 'alex_ifoe_ns' into alex_generic_collection
alexandraBara Jun 9, 2026
f7ab835
inheritance fix
alexandraBara Jun 9, 2026
dbc238a
Merge pull request #215 from amd/alex_ifoe_ns
alexandraBara Jun 9, 2026
a6279f2
Merge branch 'development' into alex_generic_collection
alexandraBara Jun 9, 2026
1cf1154
Changes to config builder unit test
amd-keonlee2 Jun 9, 2026
d638ffa
added oobgenericcollectionplugin
alexandraBara Jun 10, 2026
424a6db
docs: Update plugin documentation [automated]
github-actions[bot] Jun 10, 2026
36367c4
Merge pull request #216 from amd/automated-plugin-docs-update
alexandraBara Jun 10, 2026
e0170e5
Merge branch 'development' into config_builder_enhancements
amd-keonlee2 Jun 10, 2026
f80ccbd
utest fix
alexandraBara Jun 10, 2026
b18ac48
Reformatted
amd-keonlee2 Jun 10, 2026
1b7b248
OobBmcArchivePlugin
alexandraBara Jun 10, 2026
1442069
rename plugin to camel case
alexandraBara Jun 10, 2026
5c4bdcc
Updated ignore list for MyPy
amd-keonlee2 Jun 10, 2026
f7cb25a
updated connection manger to RedfishConnectionManager to ssh into BMC
alexandraBara Jun 10, 2026
28c7b98
Merge branch 'alex_generic_collection' into alex_collect_tars
alexandraBara Jun 10, 2026
18b391c
Merge pull request #217 from amd/config_builder_enhancements
amd-keonlee2 Jun 10, 2026
d5e62a9
updates
alexandraBara Jun 11, 2026
9c3a98f
moved connection to its own file
alexandraBara Jun 11, 2026
b48ce4a
ERROR->WARNING for correctable errors
alexandraBara Jun 11, 2026
fec6f92
added missing function
alexandraBara Jun 11, 2026
dbd87ff
Merge branch 'development' into alex_generic_collection
alexandraBara Jun 11, 2026
0d765c7
Merge branch 'alex_generic_collection' into alex_collect_tars
alexandraBara Jun 11, 2026
537af53
added missing folder
alexandraBara Jun 11, 2026
6975cf2
fix for fixtures
alexandraBara Jun 11, 2026
97dfa1c
fixed for running on unknown sku
alexandraBara Jun 11, 2026
dace37b
Merge branch 'alex_generic_collection' into alex_collect_tars
alexandraBara Jun 11, 2026
2d5af0d
py3.9
alexandraBara Jun 11, 2026
c93fdbd
updated description for fields
alexandraBara Jun 11, 2026
3d39b8e
Merge pull request #218 from amd/alex_dmesg_updates
alexandraBara Jun 11, 2026
042328b
added missing license
alexandraBara Jun 11, 2026
ca9c8c5
Merge branch 'development' into alex_generic_collection
alexandraBara Jun 11, 2026
23f91a3
Merge pull request #219 from amd/alex_generic_collection
alexandraBara Jun 11, 2026
e97ec0a
Merge branch 'development' into alex_collect_tars
alexandraBara Jun 11, 2026
69a5ea3
Merge pull request #220 from amd/alex_collect_tars
alexandraBara Jun 11, 2026
bd263a6
docs: Update plugin documentation [automated]
github-actions[bot] Jun 11, 2026
21a5088
Merge pull request #221 from amd/automated-plugin-docs-update
alexandraBara Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions docs/PLUGIN_DOC.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions nodescraper/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
from .inbandcollectortask import InBandDataCollector
from .inbanddataplugin import InBandDataPlugin
from .oobanddataplugin import OOBandDataPlugin
from .oobsshdataplugin import OOBSSHDataPlugin
from .redfishcollectortask import RedfishDataCollector
from .regexanalyzer import RegexAnalyzer

__all__ = [
"InBandDataCollector",
"InBandDataPlugin",
"OOBandDataPlugin",
"OOBSSHDataPlugin",
"RedfishDataCollector",
"RegexAnalyzer",
]
54 changes: 54 additions & 0 deletions nodescraper/base/oobsshdataplugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
###############################################################################
#
# MIT License
#
# Copyright (c) 2026 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
###############################################################################
from __future__ import annotations

from typing import Generic

from nodescraper.connection.redfish import (
RedfishConnectionManager,
RedfishConnectionParams,
)
from nodescraper.generictypes import TAnalyzeArg, TCollectArg, TDataModel
from nodescraper.interfaces import DataPlugin


class OOBSSHDataPlugin(
DataPlugin[
RedfishConnectionManager,
RedfishConnectionParams,
TDataModel,
TCollectArg,
TAnalyzeArg,
],
Generic[TDataModel, TCollectArg, TAnalyzeArg],
):
"""Base class for out-of-band (OOB) plugins that run shell commands on the BMC.

Configure the BMC using ``RedfishConnectionManager`` in the connection config.
Commands are executed over SSH (port 22) using the same host/username/password.
"""

CONNECTION_TYPE = RedfishConnectionManager
7 changes: 7 additions & 0 deletions nodescraper/configbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ def _process_value(cls, value: Any) -> Optional[Union[dict, str, int, float, lis
return_dict = {}
for key, val in value.items():
return_dict[key] = cls._process_value(val)
return return_dict

if isinstance(value, list):
return_list = []
for item in value:
return_list.append(cls._process_value(item))
return return_list

elif not isinstance(
value,
Expand Down
28 changes: 28 additions & 0 deletions nodescraper/connection/oob_ssh/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
###############################################################################
#
# MIT License
#
# Copyright (c) 2026 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
###############################################################################
from .oob_ssh_connection_manager import OobSshConnectionManager

__all__ = ["OobSshConnectionManager"]
124 changes: 124 additions & 0 deletions nodescraper/connection/oob_ssh/oob_ssh_connection_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
###############################################################################
#
# MIT License
#
# Copyright (c) 2026 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
###############################################################################
from __future__ import annotations

from logging import Logger
from typing import Optional, Union

from nodescraper.enums import EventCategory, EventPriority, ExecutionStatus
from nodescraper.interfaces.connectionmanager import ConnectionManager
from nodescraper.interfaces.taskresulthook import TaskResultHook
from nodescraper.models import SystemInfo, TaskResult
from nodescraper.utils import get_exception_traceback

from ..inband.inband import InBandConnection
from ..inband.inbandremote import RemoteShell, SSHConnectionError
from ..redfish.redfish_params import RedfishConnectionParams, redfish_params_to_ssh


class OobSshConnectionManager(ConnectionManager[InBandConnection, RedfishConnectionParams]):
"""SSH to the BMC using the same host and credentials as Redfish (OOB shell)."""

def __init__(
self,
system_info: SystemInfo,
logger: Optional[Logger] = None,
max_event_priority_level: Union[EventPriority, str] = EventPriority.CRITICAL,
parent: Optional[str] = None,
task_result_hooks: Optional[list[TaskResultHook]] = None,
connection_args: Optional[RedfishConnectionParams] = None,
**kwargs,
):
super().__init__(
system_info,
logger,
max_event_priority_level,
parent,
task_result_hooks,
connection_args,
**kwargs,
)

def connect(self) -> TaskResult:
if not self.connection_args:
self._log_event(
category=EventCategory.RUNTIME,
description="No Redfish connection parameters provided for OOB SSH",
priority=EventPriority.CRITICAL,
console_log=True,
)
self.result.status = ExecutionStatus.EXECUTION_FAILURE
return self.result

raw = self.connection_args
if isinstance(raw, dict):
params = RedfishConnectionParams.model_validate(raw)
elif isinstance(raw, RedfishConnectionParams):
params = raw
else:
self._log_event(
category=EventCategory.RUNTIME,
description="Redfish connection_args must be dict or RedfishConnectionParams",
priority=EventPriority.CRITICAL,
console_log=True,
)
self.result.status = ExecutionStatus.EXECUTION_FAILURE
return self.result

try:
ssh_params = redfish_params_to_ssh(params)
self.logger.info("Initializing OOB SSH to BMC host %s", ssh_params.hostname)
self.connection = RemoteShell(ssh_params)
self.connection.connect_ssh()
except SSHConnectionError as exception:
self._log_event(
category=EventCategory.SSH,
description=str(exception),
priority=EventPriority.CRITICAL,
console_log=True,
)
self.result.status = ExecutionStatus.EXECUTION_FAILURE
self.connection = None
except Exception as exception:
self._log_event(
category=EventCategory.SSH,
description=f"Exception during OOB SSH: {exception!s}",
data=get_exception_traceback(exception),
priority=EventPriority.CRITICAL,
console_log=True,
)
self.result.status = ExecutionStatus.EXECUTION_FAILURE
self.connection = None
return self.result

def disconnect(self) -> None:
conn = self.connection
super().disconnect()
if isinstance(conn, RemoteShell):
try:
conn.client.close()
except Exception:
pass
3 changes: 2 additions & 1 deletion nodescraper/connection/redfish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
collect_oem_diagnostic_data,
get_oem_diagnostic_allowable_values,
)
from .redfish_params import RedfishConnectionParams
from .redfish_params import RedfishConnectionParams, redfish_params_to_ssh
from .redfish_path import RedfishPath

__all__ = [
Expand All @@ -48,6 +48,7 @@
"RedfishGetResult",
"RedfishConnectionManager",
"RedfishConnectionParams",
"redfish_params_to_ssh",
"RedfishPath",
"collect_oem_diagnostic_data",
"get_oem_diagnostic_allowable_values",
Expand Down
29 changes: 29 additions & 0 deletions nodescraper/connection/redfish/redfish_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
# SOFTWARE.
#
###############################################################################
from __future__ import annotations

from typing import Optional, Union

from pydantic import BaseModel, ConfigDict, Field, SecretStr
from pydantic.networks import IPvAnyAddress

from nodescraper.connection.inband.sshparams import SSHConnectionParams

from .redfish_connection import DEFAULT_REDFISH_API_ROOT


Expand All @@ -51,3 +55,28 @@ class RedfishConnectionParams(BaseModel):
default=DEFAULT_REDFISH_API_ROOT,
description="Redfish API path (e.g. 'redfish/v1'). Override for a different API version.",
)


def redfish_params_to_ssh(
params: Union[RedfishConnectionParams, dict],
*,
ssh_port: Optional[int] = None,
key_filename: Optional[str] = None,
) -> SSHConnectionParams:
"""Map Redfish BMC credentials to SSH connection params for shell access."""
if isinstance(params, dict):
data = dict(params)
ssh_port = data.pop("ssh_port", ssh_port if ssh_port is not None else 22)
key_filename = data.pop("key_filename", key_filename)
params = RedfishConnectionParams.model_validate(data)
else:
if ssh_port is None:
ssh_port = 22

return SSHConnectionParams(
hostname=str(params.host),
username=params.username,
password=params.password,
port=ssh_port,
key_filename=key_filename,
)
2 changes: 1 addition & 1 deletion nodescraper/interfaces/connectionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __init__(
def __init_subclass__(cls, **kwargs) -> None:
super().__init_subclass__(**kwargs)

if hasattr(cls, "connect"):
if "connect" in cls.__dict__:
cls.connect = connect_decorator(cls.connect)

def __enter__(self):
Expand Down
Loading
Loading