mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-29 16:45:04 +02:00
enh(generic-snmp): output improved a little with thresholds
This commit is contained in:
parent
3e23f6af87
commit
13ff270486
@ -1,4 +1,4 @@
|
||||
use log::{debug, error, trace};
|
||||
use log::{error, trace};
|
||||
use std::str;
|
||||
|
||||
pub type Spanned<Tok, Loc, Error> = Result<(Loc, Tok, Loc), Error>;
|
||||
@ -155,7 +155,7 @@ impl<'input> Iterator for Lexer<'input> {
|
||||
}
|
||||
}
|
||||
|
||||
mod Test {
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
fn init() {
|
||||
|
@ -98,7 +98,7 @@ impl<'a> Parser<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
mod Test {
|
||||
mod test {
|
||||
use super::*;
|
||||
use log::info;
|
||||
use std::collections::HashMap;
|
||||
|
@ -116,7 +116,7 @@ impl Threshold {
|
||||
}
|
||||
}
|
||||
|
||||
mod Test {
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
|
@ -85,9 +85,14 @@ pub struct Collect {
|
||||
pub struct Command {
|
||||
collect: Collect,
|
||||
compute: Compute,
|
||||
#[serde(default = "default_output")]
|
||||
pub output: Output,
|
||||
}
|
||||
|
||||
fn default_output() -> Output {
|
||||
Output::new()
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CmdResult {
|
||||
pub status: Status,
|
||||
@ -403,7 +408,7 @@ impl Command {
|
||||
}
|
||||
|
||||
trace!("collect: {:#?}", collect);
|
||||
println!("metrics: {:#?}", metrics);
|
||||
trace!("metrics: {:#?}", metrics);
|
||||
let output_formatter = OutputFormatter::new(status, &metrics, &self.output);
|
||||
let output = output_formatter.to_string();
|
||||
Ok(CmdResult { status, output })
|
||||
|
Loading…
x
Reference in New Issue
Block a user