-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull support-bundle/queries into a standalone crate (#7193)
This pulls out sled-agent/support-bundle/queries from Omicron into a standalone sled-diagnostics crate that can be reused outside of sled-agent.
- Loading branch information
1 parent
06f8045
commit 5ef0b7d
Showing
10 changed files
with
137 additions
and
84 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "sled-diagnostics" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
futures.workspace = true | ||
omicron-workspace-hack.workspace = true | ||
thiserror.workspace = true | ||
tokio = { workspace = true, features = ["full"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
//! Diagnostics for an Oxide sled that exposes common support commands. | ||
use futures::{stream::FuturesUnordered, StreamExt}; | ||
|
||
mod queries; | ||
pub use crate::queries::{ | ||
SledDiagnosticsCmdError, SledDiagnosticsCmdOutput, | ||
SledDiagnosticsCommandHttpOutput, | ||
}; | ||
use queries::*; | ||
|
||
/// List all zones on a sled. | ||
pub async fn zoneadm_info( | ||
) -> Result<SledDiagnosticsCmdOutput, SledDiagnosticsCmdError> { | ||
execute_command_with_timeout(zoneadm_list(), DEFAULT_TIMEOUT).await | ||
} | ||
|
||
/// Retrieve various `ipadm` command output for the system. | ||
pub async fn ipadm_info( | ||
) -> Vec<Result<SledDiagnosticsCmdOutput, SledDiagnosticsCmdError>> { | ||
[ipadm_show_interface(), ipadm_show_addr(), ipadm_show_prop()] | ||
.into_iter() | ||
.map(|c| async move { | ||
execute_command_with_timeout(c, DEFAULT_TIMEOUT).await | ||
}) | ||
.collect::<FuturesUnordered<_>>() | ||
.collect::<Vec<Result<SledDiagnosticsCmdOutput, SledDiagnosticsCmdError>>>() | ||
.await | ||
} | ||
|
||
/// Retrieve various `dladm` command output for the system. | ||
pub async fn dladm_info( | ||
) -> Vec<Result<SledDiagnosticsCmdOutput, SledDiagnosticsCmdError>> { | ||
[ | ||
dladm_show_phys(), | ||
dladm_show_ether(), | ||
dladm_show_link(), | ||
dladm_show_vnic(), | ||
dladm_show_linkprop(), | ||
] | ||
.into_iter() | ||
.map(|c| async move { | ||
execute_command_with_timeout(c, DEFAULT_TIMEOUT).await | ||
}) | ||
.collect::<FuturesUnordered<_>>() | ||
.collect::<Vec<Result<SledDiagnosticsCmdOutput, SledDiagnosticsCmdError>>>() | ||
.await | ||
} |
Oops, something went wrong.