# Alerting Conditions

**URL:** <https://community.grafana.com/t/alerting-conditions/417>\
**Category:** General\
**Created:** [April 5, 2017, 2:18pm UTC](https://community.grafana.com/t/alerting-conditions/417 "2017-04-05T14:18:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbjose397](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@pbjose397](https://community.grafana.com/u/pbjose397)\
**Post date:** [April 5, 2017, 2:18pm UTC](https://community.grafana.com/t/alerting-conditions/417/1 "2017-04-05T14:18:59Z")

</div>

Can anyone provide a better description of how the conditions work. I’m having a hard time understanding what the 5m,now portion is doing. I’ve read the alerting Grafana documentation and it doesnt give a clear description either. Thanks in advance for your help! ![](https://us1.discourse-cdn.com/grafana/original/1X/40be76c815324f8259a78dd0608aebe4206f0b63.png)

---

<div class="post-metadata">

**Author:** ![torkel](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/torkel/32/20_2.png) [@torkel](https://community.grafana.com/u/torkel)\
**Post date:** [April 7, 2017, 7:55am UTC](https://community.grafana.com/t/alerting-conditions/417/2 "2017-04-07T07:55:01Z")

</div>

it’s the time range for the query, (from, to), so from 5m (ago) to now

---

<div class="post-metadata">

**Author:** ![daniellee](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/daniellee/32/41_2.png) [@daniellee](https://community.grafana.com/u/daniellee)\
**Post date:** [April 7, 2017, 7:56am UTC](https://community.grafana.com/t/alerting-conditions/417/3 "2017-04-07T07:56:38Z")

</div>

This condition means: if the query A has a max value above 95 between now and 5 minutes ago.

You could for example compare between 20 minutes ago and 5 minutes ago like this:

 ![](https://us1.discourse-cdn.com/grafana/original/1X/5fec55c8036f5106beb33b7b78790897f5f775c0.png)

---

<div class="post-metadata">

**Author:** ![nicky050](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@nicky050](https://community.grafana.com/u/nicky050)\
**Post date:** [April 11, 2017, 11:47am UTC](https://community.grafana.com/t/alerting-conditions/417/4 "2017-04-11T11:47:50Z")

</div>

Thanks for that info.

I have one more query plz.  
For now A stands for first query in the metric, so in my Grafana panel I have added the servers one by one and the rows are from A to I to show the RAM utilization graph.

How I can include the queries from A to I in one condition so that which ever server cross the threshold will trigger the email alert. (eg like Query(A-I, 5m,now) or so)

 ![](https://us1.discourse-cdn.com/grafana/original/1X/76e66d52c7423971a3f122b9bd4d7df677b745d2.png)

And to generate an email (SMTP), do I need to make any setting changes?

---

<div class="post-metadata">

**Author:** ![daniellee](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/daniellee/32/41_2.png) [@daniellee](https://community.grafana.com/u/daniellee)\
**Post date:** [April 11, 2017, 3:58pm UTC](https://community.grafana.com/t/alerting-conditions/417/5 "2017-04-11T15:58:26Z")

</div>

Why are you creating a query for every host instead of using a wildcard or regex and just having one query?

For a email, you have to configure SMTP: [Configure Grafana | Grafana documentation](http://docs.grafana.org/installation/configuration/#smtp)  
And you have to add a notification channel: [Configure notification policies | Grafana documentation](http://docs.grafana.org/alerting/notifications/#email)

 ![](https://us1.discourse-cdn.com/grafana/original/1X/8ac8748cbcafc39babcc0c7f898f7d6f010461b7.png)

---

<div class="post-metadata">

**Author:** ![nicky050](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@nicky050](https://community.grafana.com/u/nicky050)\
**Post date:** [April 11, 2017, 6:11pm UTC](https://community.grafana.com/t/alerting-conditions/417/6 "2017-04-11T18:11:36Z")

</div>

Thanks a lot Daniel for your reply.

Can you please through some insight on how I can use a wildcard or regex to have one query from all the hosts in a single dashboard panel.

I have 8 server nodes in one Hyper-V cluster and Telegraf is running from all these 8 nodes.  
I created a RAM utilization graph and added the metrics from all these 8 hosts (as shown in the above snapshot) and I am using InfluxDB as datasource.

---

<div class="post-metadata">

**Author:** ![daniellee](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/daniellee/32/41_2.png) [@daniellee](https://community.grafana.com/u/daniellee)\
**Post date:** [April 12, 2017, 3:51pm UTC](https://community.grafana.com/t/alerting-conditions/417/7 "2017-04-12T15:51:14Z")

</div>

Here is an [example from another question](https://community.grafana.com/t/grafana-influx-db-integration-for-monitoring-jmeter-performance-tests-results-in-real-time/150/8) and here is an example from my local Grafana:

![](https://us1.discourse-cdn.com/grafana/original/1X/abaf4aa220c8da3886ef1e823cd0af6059c5154f.png)

In your case, you would have one query and the where clause would look something like this:

```auto
 WHERE "host" =~ /dexxxxx*/

```

There are only a few sentences on regular expressions in the [InfluxDB documentation](https://docs.influxdata.com/influxdb/v1.2/query_language/spec/#regular-expressions).
