Hi guys,
I’ll like to know how confirm if the Occurrences I have enabled be really correctly used
I have use this documentation: http://docs.sensuapp.org/0.11/checks.html
Service definition:
{
"checks": {
"check_cpu": {
"handlers": [
"graphite", "email"
],
"command": "/etc/sensu/plugins/check_cpu.rb -w 90 -c 95",
"interval": 60,
"occurrences": 2,
"refresh": 1800,
"flapping": true,
"subscribers": ["aws"]
}
}
}
Alerts received:
FAILURE:
{
“client”: {
“name”: “puppet-01.mgmt-int”,
“address”: “XXX.30.1.5”,
“subscriptions”: [
“aws”,
“puppet_server”,
“mgmt-int”,
“SAO-Web”
],
“timestamp”: 1381279647 (Wed, 09 Oct 2013 00:47:27 GMT)
},
“check”: {
“handlers”: [
“graphite”,
“email”
],
“command”: “/etc/sensu/plugins/check_cpu.rb -w 90 -c 95”,
“interval”: 60,
"occurrences": 2,
“refresh”: 1800,
“flapping”: true,
“subscribers”: [
“aws”
],
“name”: “check_cpu”,
“issued”: 1381279724,
“executed”: 1381279660,
“output”: “CheckCPU TOTAL CRITICAL: total=100.0 user=87.0 nice=0.0 system=13.0 idle=0.0 iowait=0.0 irq=0.0 softirq=0.0 steal=0.0 guest=0.0\n”,
“status”: 2,
“duration”: 2.171,
“history”: [
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“2”
]
},
"occurrences": 1,
“action”: “create”
}
RESTORE:
{
“client”: {
“name”: “puppet-01.mgmt-int”,
“address”: “XXX.30.1.5”,
“subscriptions”: [
“aws”,
“puppet_server”,
“mgmt-int”,
“SAO-Web”
],
“timestamp”: 1381279707 (Wed, 09 Oct 2013 00:48:27 GMT)
},
“check”: {
“handlers”: [
“graphite”,
“email”
],
“command”: “/etc/sensu/plugins/check_cpu.rb -w 90 -c 95”,
“interval”: 60,
“occurrences”: 2,
“refresh”: 1800,
“flapping”: true,
“subscribers”: [
“aws”
],
“name”: “check_cpu”,
“issued”: 1381279784,
“executed”: 1381279720,
“output”: “CheckCPU TOTAL OK: total=8.08 user=2.02 nice=0.0 system=5.05 idle=91.92 iowait=1.01 irq=0.0 softirq=0.0 steal=0.0 guest=0.0\n”,
“status”: 0,
“duration”: 1.249,
“history”: [
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“2”,
“0”
]
},
“occurrences”: 1,
“action”: “resolve”
}
I have something wrong? that i get email immediately before the check run. Flapping can be enabled with Occurrences at the same time?
thanks in advance!
Alejandro