From 6ae132aeebff2c797e4ea300b1d259cecb9701a4 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 31 Oct 2023 17:01:15 -0500 Subject: [PATCH] Update Rules.md --- doc/Alerting/Rules.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Alerting/Rules.md b/doc/Alerting/Rules.md index 0f655217c6..8806963aa2 100644 --- a/doc/Alerting/Rules.md +++ b/doc/Alerting/Rules.md @@ -72,7 +72,8 @@ On the Advanced tab, you can specify some additional options for the alert rule: - An example of this would be an average rule for all CPUs over 10% ```sql -SELECT devices.*, (SELECT AVG(processors.processor_usage) as sub_avg FROM processors WHERE processors.device_id = devices.device_id HAVING AVG(processors.processor_usage) > 10) as cpu_avg +SELECT devices.*, (SELECT AVG(processors.processor_usage) as sub_avg FROM processors WHERE processors.device_id = devices.device_id + HAVING AVG(processors.processor_usage) >= 10) as cpu_avg FROM devices WHERE devices.device_id = ? AND (devices.status = 1 && (devices.disabled = 0 && devices.ignore = 0)) = 1; ```