hello guys i'm having a problem with the notifications, my slack.json config is the next:
{
"handlers": {
"slack_plataformasdigitales": {
"type": "pipe",
"command": "handler-slack.rb -j slack_plataformasdigitales",
"severities": ["critical", "unknown", "ok" ]
}
},
"slack_plataformasdigitales": {
"webhook_url": "http://webhoook",
"username": "sensu",
"channel": "#alertas",
"timeout": 10
}
}
i need alerts only for critical, ok and unknown. When the check exit 0, 2 or higer i need the notifications, if the cheks go from 2 or higer to 0 the alert is send to slack, but if the check go trought 2 or higer, then 1, and then 0, i only have the critical or unknown alert but never send the ok alert, this is a problem because i check cpu usage, and the team only see the errors and never the resolution, and then go to check the server and this is working fine.
im using ubuntu 14.04.05, sensu 0.26.3 and the latest version of sensu slack plugin.
this is the check
"prod_linux_load": {
"command": "check-load.rb -c 1.25,1,0.95 --per-core",
"interval": 15,
"occurrences": 6,
"refresh": 300,
"subscribers": ["linux_PlatDigCloudServices", "linux_PlatDigSmartProd01", "linux_PlatDigGrillasProd01", "elasticsearch_PlatDigCloudServices", "linux_PlatDigMarketing01", "linux_PlatDigInterProd01"],
"handlers": ["slack_plataformasdigitales"]
}
and this is the log of the sensu server
"timestamp": "2016-12-01T10:07:41.007359-0300",
"level": "info",
"message": "processing event",
"event": {
"client": {
"name": "PlatDigInfluxDB01",
"address": "10.0.0.80",
"subscriptions": ["linux_PlatDigCloudServices", "client:PlatDigInfluxDB01"],
"keepalive": {
"thresholds": {
"warning": 30,
"critical": 60
},
"handlers": ["slack"],
"refresh": 60
},
"version": "0.26.3",
"timestamp": 1480597654
},
"check": {
"command": "check-load.rb -w 0.8,0.8,0.8 -c 0.95,0.95,0.95 --per-core",
"interval": 15,
"occurrences": 6,
"refresh": 300,
"subscribers": ["linux_PlatDigCloudServices", "linux_PlatDigSmartProd01", "linux_PlatDigGrillasProd01", "elasticsearch_PlatDigCloudServices", "linux_PlatDigMarketing01"],
"handlers": ["slack_plataformasdigitales"],
"name": "prod_linux_load",
"issued": 1480597660,
"executed": 1480597660,
"duration": 0.102,
"output": "CheckLoad CRITICAL: Load average: 1.0, 0.57, 0.3\n",
"status": 2,
"type": "standard",
"history": ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "2", "2", "2", "2", "2"],
"total_state_change": 11
},
"occurrences": 5,
"occurrences_watermark": 5,
"action": "create",
"timestamp": 1480597661,
"id": "dacbe316-0f1a-4d7b-bfc8-8a32125cb416",
"last_state_change": 1480597601,
"last_ok": 1480597586,
"silenced": false,
"silenced_by": []
}
}{
"timestamp": "2016-12-01T10:07:41.773114-0300",
"level": "info",
"message": "handler output",
"handler": {
"type": "pipe",
"command": "handler-slack.rb -j slack_plataformasdigitales",
"severities": ["critical", "unknown", "ok"],
"name": "slack_plataformasdigitales"
},
"output": ["warning: event filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nwarning: occurrence filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nnot enough occurrences: PlatDigInfluxDB01/prod_linux_load\n"]
}
{
"timestamp": "2016-12-01T10:08:26.028076-0300",
"level": "info",
"message": "processing event",
"event": {
"client": {
"name": "PlatDigInfluxDB01",
"address": "10.0.0.80",
"subscriptions": ["linux_PlatDigCloudServices", "client:PlatDigInfluxDB01"],
"keepalive": {
"thresholds": {
"warning": 30,
"critical": 60
},
"handlers": ["slack"],
"refresh": 60
},
"version": "0.26.3",
"timestamp": 1480597694
},
"check": {
"command": "check-load.rb -w 0.8,0.8,0.8 -c 0.95,0.95,0.95 --per-core",
"interval": 15,
"occurrences": 6,
"refresh": 300,
"subscribers": ["linux_PlatDigCloudServices", "linux_PlatDigSmartProd01", "linux_PlatDigGrillasProd01", "elasticsearch_PlatDigCloudServices", "linux_PlatDigMarketing01"],
"handlers": ["slack_plataformasdigitales"],
"name": "prod_linux_load",
"issued": 1480597705,
"executed": 1480597705,
"duration": 0.106,
"output": "CheckLoad WARNING: Load average: 0.92, 0.62, 0.33\n",
"status": 1,
"type": "standard",
"history": ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "2", "2", "2", "2", "2", "2", "2", "1"],
"total_state_change": 16
},
"occurrences": 1,
"occurrences_watermark": 7,
"action": "create",
"timestamp": 1480597706,
"id": "dacbe316-0f1a-4d7b-bfc8-8a32125cb416",
"last_state_change": 1480597706,
"last_ok": 1480597586,
"silenced": false,
"silenced_by": []
}
}{
"timestamp": "2016-12-01T10:08:26.028258-0300",
"level": "info",
"message": "handler does not handle event severity",
"handler": {
"type": "pipe",
"command": "handler-slack.rb -j slack_plataformasdigitales",
"severities": ["critical", "unknown", "ok"],
"name": "slack_plataformasdigitales"
},
"event": {
"client": {
"name": "PlatDigInfluxDB01",
"address": "10.0.0.80",
"subscriptions": ["linux_PlatDigCloudServices", "client:PlatDigInfluxDB01"],
"keepalive": {
"thresholds": {
"warning": 30,
"critical": 60
},
"handlers": ["slack"],
"refresh": 60
},
"version": "0.26.3",
"timestamp": 1480597694
},
"check": {
"command": "check-load.rb -w 0.8,0.8,0.8 -c 0.95,0.95,0.95 --per-core",
"interval": 15,
"occurrences": 6,
"refresh": 300,
"subscribers": ["linux_PlatDigCloudServices", "linux_PlatDigSmartProd01", "linux_PlatDigGrillasProd01", "elasticsearch_PlatDigCloudServices", "linux_PlatDigMarketing01"],
"handlers": ["slack_plataformasdigitales"],
"name": "prod_linux_load",
"issued": 1480597705,
"executed": 1480597705,
"duration": 0.106,
"output": "CheckLoad WARNING: Load average: 0.92, 0.62, 0.33\n",
"status": 1,
"type": "standard",
"history": ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "2", "2", "2", "2", "2", "2", "2", "1"],
"total_state_change": 16
},
"occurrences": 1,
"occurrences_watermark": 7,
"action": "create",
"timestamp": 1480597706,
"id": "dacbe316-0f1a-4d7b-bfc8-8a32125cb416",
"last_state_change": 1480597706,
"last_ok": 1480597586,
"silenced": false,
"silenced_by": []
}
}{
"timestamp": "2016-12-01T10:08:41.031381-0300",
"level": "info",
"message": "processing event",
"event": {
"client": {
"name": "PlatDigInfluxDB01",
"address": "10.0.0.80",
"subscriptions": ["linux_PlatDigCloudServices", "client:PlatDigInfluxDB01"],
"keepalive": {
"thresholds": {
"warning": 30,
"critical": 60
},
"handlers": ["slack"],
"refresh": 60
},
"version": "0.26.3",
"timestamp": 1480597714
},
"check": {
"command": "check-load.rb -w 0.8,0.8,0.8 -c 0.95,0.95,0.95 --per-core",
"interval": 15,
"occurrences": 6,
"refresh": 300,
"subscribers": ["linux_PlatDigCloudServices", "linux_PlatDigSmartProd01", "linux_PlatDigGrillasProd01", "elasticsearch_PlatDigCloudServices", "linux_PlatDigMarketing01"],
"handlers": ["slack_plataformasdigitales"],
"name": "prod_linux_load",
"issued": 1480597720,
"executed": 1480597720,
"duration": 0.11,
"output": "CheckLoad OK: Load average: 0.72, 0.59, 0.33\n",
"status": 0,
"type": "standard",
"history": ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "2", "2", "2", "2", "2", "2", "2", "1", "0"],
"total_state_change": 22
},
"occurrences": 1,
"occurrences_watermark": 7,
"action": "resolve",
"timestamp": 1480597721,
"id": "dacbe316-0f1a-4d7b-bfc8-8a32125cb416",
"last_state_change": 1480597721,
"last_ok": 1480597721,
"silenced": false,
"silenced_by": []
}
}{
"timestamp": "2016-12-01T10:08:41.814917-0300",
"level": "info",
"message": "handler output",
"handler": {
"type": "pipe",
"command": "handler-slack.rb -j slack_plataformasdigitales",
"severities": ["critical", "unknown", "ok"],
"name": "slack_plataformasdigitales"
},
"output": ["warning: event filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nwarning: occurrence filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nnot enough occurrences: PlatDigInfluxDB01/prod_linux_load\n"]
}
P.S.: Sorry for my bad English!!