Netdata Community

zscore in netdata agent health

Following from this discussion and a few others. Zscore on health alarm calc - #5 by andrewm4894

It would be nice if there was a zscore function in the agent so users could just derive alarms based on a zscore.

The agent already has the relevant underlying functions of mean and sttdev, so this would just be wrapping them up such that

z = (x - mean) / stddev

For reference i was able to derive a zscore based on this work around:

 alarm: cpu_user_mean
    on: system.cpu
lookup: mean -60s of user
 every: 10s

 alarm: cpu_user_stddev
    on: system.cpu
lookup: stddev -60s of user
 every: 10s

 alarm: cpu_user_zscore
    on: system.cpu
lookup: mean -10s of user
  calc: ($this - $cpu_user_mean) / $cpu_user_stddev
 every: 10s
  warn: $this < -2 or $this > 2
  crit: $this < -3 or $this > 3

But it would be nice and useful to just be able to do it as one alarm definition.