-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
132 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,9 @@ | ||
[package] | ||
name = "sled-diagnostics" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
futures.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.