# Handling Aggregates in Sensu Core 1.x

**URL:** <https://discourse.sensu.io/t/handling-aggregates-in-sensu-core-1-x/1147>\
**Category:** Sensu Classic (EOL)\
**Tags:** handlers, aggregates\
**Created:** [April 22, 2019, 3:08pm UTC](https://discourse.sensu.io/t/handling-aggregates-in-sensu-core-1-x/1147 "2019-04-22T15:08:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronsachs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/aaronsachs/32/47_2.png) [@aaronsachs](https://discourse.sensu.io/u/aaronsachs)\
**Post date:** [April 22, 2019, 3:08pm UTC](https://discourse.sensu.io/t/handling-aggregates-in-sensu-core-1-x/1147/1 "2019-04-22T15:08:11Z")

</div>

A quick discussion on hoow to handle aggregates in Sensu Core 1.x from the [Community Slack](https://slack.sensu.io)

> [@](#):
>
> [**View in #help on Slack**](https://slack.com/archives/C68LV5M9U/p1555933065069900)
> 
> **@mdelaney:** Is it possible to have a handler on an `aggregate`?
> 
> **@aaronsachs:** @mdelaney indeed it is.  
> Just add the `"handlers":[]` scope with your desired handlers
> 
> **@mdelaney:** @aaronsachs Dol you happen to have some docs on hand that show this?
> 
> **@aaronsachs:** Hmmmm  
> it doesn’t look like the aggregates reference show this  
> But, it’s definitely possible  
> I’ll open an issue on the repo to have this added.
> 
> **@mdelaney:** Awesome, thank you.
> 
> **@aaronsachs:** @mdelaney before I do that, how do you have your aggregate set up?  
> It’s worth noting that aggregates themselves don’t alert  
> You have to configure a check to query them and put the handler there
> 
> ```
> {
> "checks": {
> "check_http_8080": {
> "command": "check-http.rb -u http://127.0.0.1:8080",
> "interval": 10,
> "handle": false,
> "standalone": true,
> "aggregate": "http_ports"
> }
> }
> }
> {
> "checks": {
> "check_http_8088": {
> "command": "check-http.rb -u http://127.0.0.1:8088",
> "interval": 10,
> "handle": false,
> "standalone": true,
> "aggregate": "http_ports"
> }
> }
> }
> {
> "checks": {
> "check_http_8888": {
> "command": "check-http.rb -u http://127.0.0.1:8888",
> "interval": 10,
> "handle": false,
> "standalone": true,
> "aggregate": "http_ports"
> }
> }
> }
> {
> "checks": {
> "check_http_ports_aggregate": {
> "command": "check-aggregate.rb -c http_ports --warning 30 --critical 60",
> "interval": 10,
> "standalone": true,
> "handlers":["email"]
> }
> }
> }
> 
> ```
> 
> **@mdelaney:** @aaronsachs That is actually pretty damn close to how things are setup, sans the last element `check_http_ports_aggregate`.
> 
> **@aaronsachs:** 👍  
> Yeah, so if you have the check that queries the aggregate, that should get you what you need
> 
> **@mdelaney:** Perfect, I’ll give that a shot.
> 
> **@aaronsachs:** Woot! 🙌
> 
> **@mdelaney:** 🪨

---

<div class="post-metadata">

**Author:** ![majormoses](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/majormoses/32/62_2.png) [@majormoses](https://discourse.sensu.io/u/majormoses)\
**Post date:** [April 27, 2019, 6:04pm UTC](https://discourse.sensu.io/t/handling-aggregates-in-sensu-core-1-x/1147/2 "2019-04-27T18:04:47Z")

</div>

I will see about updating my example in my guide: [https://blog.sensu.io/alert-fatigue-part-4-alert-consolidation](https://blog.sensu.io/alert-fatigue-part-4-alert-consolidation) with a handlers example. I guess I never really thought about not including it, I took that from my slides where I was trying to save real estate for common check config. Essentially you want the handlers set on the check that is checking the aggregate not the check that creates and updates the aggregate.
