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

NAS-132534 / 25.04 / Add jbof and rdma #242

Merged
merged 5 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions ixdiagnose/plugins/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import typing

from ixdiagnose.utils.command import Command
from ixdiagnose.utils.formatter import remove_keys
from ixdiagnose.utils.middleware import MiddlewareClient, MiddlewareCommand
from ixdiagnose.utils.run import run

Expand Down Expand Up @@ -49,6 +50,8 @@ class Hardware(Plugin):
MiddlewareClientMetric('enclosures', [MiddlewareCommand('enclosure.query')]),
MiddlewareClientMetric('virtualization_variant', [MiddlewareCommand('hardware.virtualization.variant')]),
MiddlewareClientMetric('is_virtualized', [MiddlewareCommand('hardware.virtualization.is_virtualized')]),
MiddlewareClientMetric('jbof_config', [MiddlewareCommand('jbof.query',
format_output=remove_keys(['mgmt_password']))]),
PythonMetric('nvdimm_info', nvdimm_info, serializable=False),
]
raw_metrics = [
Expand Down
24 changes: 22 additions & 2 deletions ixdiagnose/plugins/network.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
from typing import Any

from ixdiagnose.utils.command import Command
from ixdiagnose.utils.middleware import MiddlewareCommand
from ixdiagnose.utils.formatter import dumps
from ixdiagnose.utils.middleware import MiddlewareClient, MiddlewareCommand

from .base import Plugin
from .metrics import CommandMetric, FileMetric, MiddlewareClientMetric
from .metrics import CommandMetric, FileMetric, MiddlewareClientMetric, PythonMetric


def link_choices(client: MiddlewareClient, context: Any) -> str:
summary = {}
configured_interfaces = client.call('interface.get_configured_interfaces')
for link in client.call('rdma.get_link_choices', True):
summary[link['netdev']] = link | {'configured_interface': link['netdev'] in configured_interfaces}

return dumps(summary)


class Network(Plugin):
Expand All @@ -29,6 +41,14 @@ class Network(Plugin):
MiddlewareCommand('route.system_routes'),
]
),
MiddlewareClientMetric(
'rdma_config', [
MiddlewareCommand('rdma.capable_protocols', result_key='capable_protocols'),
MiddlewareCommand('rdma.get_card_choices', result_key='card_choices'),
MiddlewareCommand('rdma.interface.query', result_key='interfaces'),
]
),
PythonMetric('rdma_link_choices', link_choices),
]
raw_metrics = [
CommandMetric(
Expand Down
Loading