mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-29 16:45:04 +02:00
fix(generic-snmp): the warning/critical thresholds can be empty now
This commit is contained in:
parent
b6f8684848
commit
38a243e914
@ -83,7 +83,11 @@ fn main() -> Result<(), Error> {
|
||||
let value = parser.value().unwrap().into_string().unwrap();
|
||||
match cmd.as_mut() {
|
||||
Some(ref mut cmd) => {
|
||||
cmd.add_warning(&wmetric, value);
|
||||
if (!value.is_empty()) {
|
||||
cmd.add_warning(&wmetric, value);
|
||||
} else {
|
||||
trace!("Warning metric '{}' is empty", wmetric);
|
||||
}
|
||||
}
|
||||
None => {
|
||||
println!("json is empty");
|
||||
@ -95,7 +99,11 @@ fn main() -> Result<(), Error> {
|
||||
let value = parser.value().unwrap().into_string().unwrap();
|
||||
match cmd.as_mut() {
|
||||
Some(ref mut cmd) => {
|
||||
cmd.add_critical(&cmetric, value);
|
||||
if (!value.is_empty()) {
|
||||
cmd.add_critical(&cmetric, value);
|
||||
} else {
|
||||
trace!("Critical metric '{}' is empty", cmetric);
|
||||
}
|
||||
}
|
||||
None => {
|
||||
println!("json is empty");
|
||||
|
Loading…
x
Reference in New Issue
Block a user