mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-09-25 18:58:39 +02:00
fix(generic-snmp): remove threshold_suffix
I don't remember why it was created, and i think we can use the name to point threshold ?
This commit is contained in:
parent
4a6ff4d997
commit
5a2a35720a
@ -22,8 +22,6 @@ pub struct Metric {
|
||||
pub min: Option<f64>,
|
||||
pub max_expr: Option<String>,
|
||||
pub max: Option<f64>,
|
||||
#[serde(rename = "threshold-suffix")]
|
||||
pub threshold_suffix: Option<String>,
|
||||
pub warning: Option<String>,
|
||||
pub critical: Option<String>,
|
||||
}
|
||||
|
@ -121,10 +121,7 @@ impl Command {
|
||||
self.compute
|
||||
.metrics
|
||||
.iter_mut()
|
||||
.find(|metric| match &metric.threshold_suffix {
|
||||
Some(suffix) => suffix == name,
|
||||
None => false,
|
||||
})
|
||||
.find(|metric| &metric.name == name)
|
||||
{
|
||||
debug!("Adding warning to metric {}", metric.name);
|
||||
metric.warning = Some(value);
|
||||
@ -132,10 +129,7 @@ impl Command {
|
||||
if let Some(metric) =
|
||||
aggregations
|
||||
.iter_mut()
|
||||
.find(|metric| match &metric.threshold_suffix {
|
||||
Some(suffix) => suffix == name,
|
||||
None => false,
|
||||
})
|
||||
.find(|metric| &metric.name == name)
|
||||
{
|
||||
debug!("Adding warning to aggregation metric {}", metric.name);
|
||||
metric.warning = Some(value);
|
||||
@ -148,10 +142,7 @@ impl Command {
|
||||
self.compute
|
||||
.metrics
|
||||
.iter_mut()
|
||||
.find(|metric| match &metric.threshold_suffix {
|
||||
Some(suffix) => suffix == name,
|
||||
None => false,
|
||||
})
|
||||
.find(|metric| &metric.name == name)
|
||||
{
|
||||
metric.critical = Some(value);
|
||||
debug!("Adding critical to metric {}", metric.name);
|
||||
@ -159,10 +150,7 @@ impl Command {
|
||||
if let Some(metric) =
|
||||
aggregations
|
||||
.iter_mut()
|
||||
.find(|metric| match &metric.threshold_suffix {
|
||||
Some(suffix) => suffix == name,
|
||||
None => false,
|
||||
})
|
||||
.find(|metric| &metric.name == name)
|
||||
{
|
||||
debug!("Adding critical to aggregation metric {}", metric.name);
|
||||
metric.critical = Some(value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user