mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-09-25 02:37:57 +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 min: Option<f64>,
|
||||||
pub max_expr: Option<String>,
|
pub max_expr: Option<String>,
|
||||||
pub max: Option<f64>,
|
pub max: Option<f64>,
|
||||||
#[serde(rename = "threshold-suffix")]
|
|
||||||
pub threshold_suffix: Option<String>,
|
|
||||||
pub warning: Option<String>,
|
pub warning: Option<String>,
|
||||||
pub critical: Option<String>,
|
pub critical: Option<String>,
|
||||||
}
|
}
|
||||||
|
@ -121,10 +121,7 @@ impl Command {
|
|||||||
self.compute
|
self.compute
|
||||||
.metrics
|
.metrics
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|metric| match &metric.threshold_suffix {
|
.find(|metric| &metric.name == name)
|
||||||
Some(suffix) => suffix == name,
|
|
||||||
None => false,
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
debug!("Adding warning to metric {}", metric.name);
|
debug!("Adding warning to metric {}", metric.name);
|
||||||
metric.warning = Some(value);
|
metric.warning = Some(value);
|
||||||
@ -132,10 +129,7 @@ impl Command {
|
|||||||
if let Some(metric) =
|
if let Some(metric) =
|
||||||
aggregations
|
aggregations
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|metric| match &metric.threshold_suffix {
|
.find(|metric| &metric.name == name)
|
||||||
Some(suffix) => suffix == name,
|
|
||||||
None => false,
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
debug!("Adding warning to aggregation metric {}", metric.name);
|
debug!("Adding warning to aggregation metric {}", metric.name);
|
||||||
metric.warning = Some(value);
|
metric.warning = Some(value);
|
||||||
@ -148,10 +142,7 @@ impl Command {
|
|||||||
self.compute
|
self.compute
|
||||||
.metrics
|
.metrics
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|metric| match &metric.threshold_suffix {
|
.find(|metric| &metric.name == name)
|
||||||
Some(suffix) => suffix == name,
|
|
||||||
None => false,
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
metric.critical = Some(value);
|
metric.critical = Some(value);
|
||||||
debug!("Adding critical to metric {}", metric.name);
|
debug!("Adding critical to metric {}", metric.name);
|
||||||
@ -159,10 +150,7 @@ impl Command {
|
|||||||
if let Some(metric) =
|
if let Some(metric) =
|
||||||
aggregations
|
aggregations
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|metric| match &metric.threshold_suffix {
|
.find(|metric| &metric.name == name)
|
||||||
Some(suffix) => suffix == name,
|
|
||||||
None => false,
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
debug!("Adding critical to aggregation metric {}", metric.name);
|
debug!("Adding critical to aggregation metric {}", metric.name);
|
||||||
metric.critical = Some(value);
|
metric.critical = Some(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user