Window and Mean not working as expected

Hi there,

my task is not working as expected.The alert is triggered even if the mean is not below 20k for the last 5 minutes.

dbrp "telegraf"."autogen"

stream
    |from()
        .measurement('derivatives')
        .where(lambda: "ifIndex" == '9' OR "ifIndex" == '10' OR "ifIndex" == '16')
	    .groupBy('ifIndex')
	|window()
        .period(300s)
        .every(300s)
	|mean('ifInOctetsDerivate')
    |alert()
        .message('Durchsatz unter 20000 > {{ index .Fields "mean" }}')
        .crit(lambda: "mean" < 20000.0)
        .mqtt('camdown/{{ index .Tags "ifIndex" }}')
            .qos(0)

Please advice.

Regards

Tim

I think i have found the solution.
Seems like the ifInOctetsDerivate had big negative numbers once a day, which i fixed with nonnegative in the according task.

Plus i added fillperiod in this task here.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.