cli lil fixes
parent
56f8474c01
commit
a9c0aa14fa
|
|
@ -48,9 +48,9 @@ pub enum Commands {
|
|||
)]
|
||||
Config(ConfigCommand),
|
||||
#[command(
|
||||
about = "To get Noxis metrics",
|
||||
about = "To inspect system metrics in restricted mode",
|
||||
)]
|
||||
Metrics(MetricsCommand),
|
||||
Inspect(MetricsCommand),
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser, serde::Serialize, serde::Deserialize)]
|
||||
|
|
@ -179,13 +179,31 @@ pub enum ProcessAction {
|
|||
pub mod metrics_models {
|
||||
#[derive(Debug, clap::Parser, serde::Serialize, serde::Deserialize)]
|
||||
pub enum MetricsMode {
|
||||
#[command(
|
||||
about = "To capture all metrics about undercontrolled system",
|
||||
)]
|
||||
Full,
|
||||
// system
|
||||
#[command(
|
||||
about = "To capture detailed CPU metrics",
|
||||
)]
|
||||
Cpu,
|
||||
#[command(
|
||||
about = "To capture RAM metrics",
|
||||
)]
|
||||
Ram,
|
||||
#[command(
|
||||
about = "To capture disk environment metrics",
|
||||
)]
|
||||
Rom,
|
||||
#[command(
|
||||
about = "To capture system net interfaces metrics",
|
||||
)]
|
||||
Network,
|
||||
// processes
|
||||
#[command(
|
||||
about = "To capture monitoring processes metrics",
|
||||
)]
|
||||
Processes
|
||||
// Config
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ async fn process_cli_cmd(
|
|||
},
|
||||
/* */
|
||||
Commands::Status => Ok(String::from("Ok")),
|
||||
Commands::Metrics(mode) => {
|
||||
Commands::Inspect(mode) => {
|
||||
use crate::options::structs::bus::{BusMessageDirection, BusMessageContentType};
|
||||
let mode = mode.mode;
|
||||
if let Ok(()) = bus_sender.send(BusMessage::Request(
|
||||
|
|
|
|||
Loading…
Reference in New Issue