I need sample alerting rule

dear all
i need use grafana for monitoring our linux servers , but i can’t create alerting for node-exporter!
could you please send to me sample alerting rule for import to my grafana and learn how create rules for node-exporter?

Hello,

take for example the “Memory Basic” visualization:

Click on the alert section and then on “Create alert rule from this panel”

Pick what metric you want to set an alert on and give the alert a name.

For this case, I will set an alert to fire when the RAM used is 80% of the total RAM, so I will keep the metrics of the total memory and the ram usage.
(I picked only the “node/instance” 1, if you want to set the alert for all the nodes, omit the “node/instance” label in order to generate sub alertes for each available node.)

You see that it is a timeseries, you need to reduce it in order to make a condition on it; For this case, I will take the last value.

Press “Add expression”, pick “Reduce” and the function “Last”:

Add another expression which will be the alert condition:

For the other settings, I advise you to read this documentation: Alerting | Grafana documentation

1 Like

Many thanks for your explains , could you please explain the difference between Strict mode and Drop non-Numeric Value in Reduce ?

You will find everything you need in here: Write expression queries | Grafana documentation

1 Like

Also is that true use this method for set an alert to fire when the RAM used is 80%?

No this condition will be true when the value of “Usedmemory” is above 80.

You said 80%, 80 percent of what? The “Threshold” expression can’t let you compare the “usedmemory” variable with another; It’s better to use the “Math” expression, it gives you a lot of flexibility.

1 Like