diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2018-11-10 00:55:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-10 00:55:30 +0200 |
commit | ee1b7ef695f8c8d16cb77425841d477b564ee125 (patch) | |
tree | ba2665ce95570e92636dfd2c612a3ecf90da0d4b /health | |
parent | 9e820a3b38e490863aff3863e63e471f471e76cc (diff) |
fixed max interface speed calculation (#4594)
Diffstat (limited to 'health')
-rw-r--r-- | health/health.d/net.conf | 14 | ||||
-rw-r--r-- | health/health_config.c | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/health/health.d/net.conf b/health/health.d/net.conf index 489016dd56..ae3c26ec61 100644 --- a/health/health.d/net.conf +++ b/health/health.d/net.conf @@ -4,13 +4,23 @@ # ----------------------------------------------------------------------------- # net traffic overflow + template: interface_speed + on: net.net + os: * + hosts: * + families: * + calc: ( $nic_speed_max > 0 ) ? ( $nic_speed_max) : ( nan ) + units: Mbit + every: 10s + info: The current speed of the physical network interface + template: 1m_received_traffic_overflow on: net.net os: linux hosts: * families: * lookup: average -1m unaligned absolute of received - calc: ($nic_speed_max > 0) ? ($this * 100 / ($nic_speed_max * 1000)) : ( nan ) + calc: ($interface_speed > 0) ? ($this * 100 / ($interface_speed * 1000)) : ( nan ) units: % every: 10s warn: $this > (($status >= $WARNING) ? (80) : (85)) @@ -25,7 +35,7 @@ hosts: * families: * lookup: average -1m unaligned absolute of sent - calc: ($nic_speed_max > 0) ? ($this * 100 / ($nic_speed_max * 1000)) : ( nan ) + calc: ($interface_speed > 0) ? ($this * 100 / ($interface_speed * 1000)) : ( nan ) units: % every: 10s warn: $this > (($status >= $WARNING) ? (80) : (85)) diff --git a/health/health_config.c b/health/health_config.c index d4af9776fb..d4cf78d973 100644 --- a/health/health_config.c +++ b/health/health_config.c @@ -84,7 +84,7 @@ static inline int rrdcalctemplate_add_template_from_config(RRDHOST *host, RRDCAL return 0; } - if(unlikely(!RRDCALCTEMPLATE_HAS_CALCULATION(rt) && !rt->warning && !rt->critical)) { + if(unlikely(!RRDCALCTEMPLATE_HAS_DB_LOOKUP(rt) && !rt->calculation && !rt->warning && !rt->critical)) { error("Health configuration for template '%s' is useless (no calculation, no warning and no critical evaluation)", rt->name); return 0; } |