We have seen a few cases when RESOLVED email is not sent by sensu after Warning alert is cleared.
We are using the community mailer.rb plugin for this. This is one of the examples I managed to capture...Here are the server logs if it helps:
sensu version = 0.9.7-1
Ubuntu 12.04LTS
this is the check definition:
{
"checks": {
"iowait_check": {
"notification": "IOwait too high",
"handler": "default",
"command": "/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40",
"interval": 60,
"subscribers": [ "all" ],
"low_flap_threshold" : 5,
"occurrences": 2,
"refresh": 60,
"high_flap_threshold" : 20
}
}
}
{"timestamp":"2012-10-24T10:32:03.637417+0000","message":"handling event","event":{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074710},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074720,"output":"CPU STATISTICS WARNING : user=5.05% system=5.05% iowait=34.86% idle=50.24% nice=0.00% steal=4.81% | CpuUser=5.05;CpuSystem=5.05;CpuIoWait=34.86;CpuIdle=50.24;CpuNice=0.00;CpuSteal=4.81;25;40\n","status":1,"duration":2.701,"history":["0","0","0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1"],"flapping":false},"occurrences":1,"action":"create"},"handler":{"command":"/etc/sensu/handlers/debug.rb","type":"pipe","name":"debug"},"level":"info"}
{"timestamp":"2012-10-24T10:32:03.637861+0000","message":"handling event","event":{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074710},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074720,"output":"CPU STATISTICS WARNING : user=5.05% system=5.05% iowait=34.86% idle=50.24% nice=0.00% steal=4.81% | CpuUser=5.05;CpuSystem=5.05;CpuIoWait=34.86;CpuIdle=50.24;CpuNice=0.00;CpuSteal=4.81;25;40\n","status":1,"duration":2.701,"history":["0","0","0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1"],"flapping":false},"occurrences":1,"action":"create"},"handler":{"command":"/etc/sensu/handlers/mailer.rb","type":"pipe","name":"email"},"level":"info"}
{"timestamp":"2012-10-24T10:32:03.692054+0000","message":"{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074710},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074720,"output":"CPU STATISTICS WARNING : user=5.05% system=5.05% iowait=34.86% idle=50.24% nice=0.00% steal=4.81% | CpuUser=5.05;CpuSystem=5.05;CpuIoWait=34.86;CpuIdle=50.24;CpuNice=0.00;CpuSteal=4.81;25;40\n","status":1,"duration":2.701,"history":["0","0","0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1"],"flapping":false},"occurrences":1,"action":"create"}","level":"info"}
{"timestamp":"2012-10-24T10:32:04.431209+0000","message":"not enough occurrences: app02.live.production/iowait_check","level":"info"}
{"timestamp":"2012-10-24T10:33:03.355071+0000","message":"handling event","event":{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074770},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074780,"output":"CPU STATISTICS WARNING : user=9.14% system=2.96% iowait=29.14% idle=56.54% nice=0.00% steal=2.22% | CpuUser=9.14;CpuSystem=2.96;CpuIoWait=29.14;CpuIdle=56.54;CpuNice=0.00;CpuSteal=2.22;25;40\n","status":1,"duration":2.406,"history":["0","0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1","1"],"flapping":false},"occurrences":2,"action":"create"},"handler":{"command":"/etc/sensu/handlers/debug.rb","type":"pipe","name":"debug"},"level":"info"}
{"timestamp":"2012-10-24T10:33:03.355478+0000","message":"handling event","event":{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074770},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074780,"output":"CPU STATISTICS WARNING : user=9.14% system=2.96% iowait=29.14% idle=56.54% nice=0.00% steal=2.22% | CpuUser=9.14;CpuSystem=2.96;CpuIoWait=29.14;CpuIdle=56.54;CpuNice=0.00;CpuSteal=2.22;25;40\n","status":1,"duration":2.406,"history":["0","0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1","1"],"flapping":false},"occurrences":2,"action":"create"},"handler":{"command":"/etc/sensu/handlers/mailer.rb","type":"pipe","name":"email"},"level":"info"}
{"timestamp":"2012-10-24T10:33:03.417633+0000","message":"{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074770},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074780,"output":"CPU STATISTICS WARNING : user=9.14% system=2.96% iowait=29.14% idle=56.54% nice=0.00% steal=2.22% | CpuUser=9.14;CpuSystem=2.96;CpuIoWait=29.14;CpuIdle=56.54;CpuNice=0.00;CpuSteal=2.22;25;40\n","status":1,"duration":2.406,"history":["0","0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1","1"],"flapping":false},"occurrences":2,"action":"create"}","level":"info"}
{"timestamp":"2012-10-24T10:34:03.065661+0000","message":"handling event","event":{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074830},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074840,"output":"CPU STATISTICS OK : user=0.51% system=0.76% iowait=0.00% idle=98.74% nice=0.00% steal=0.00% | CpuUser=0.51;CpuSystem=0.76;CpuIoWait=0.00;CpuIdle=98.74;CpuNice=0.00;CpuSteal=0.00;25;40\n","status":0,"duration":2.112,"history":["0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1","1","0"]},"occurrences":2,"action":"resolve"},"handler":{"command":"/etc/sensu/handlers/debug.rb","type":"pipe","name":"debug"},"level":"info"}
{"timestamp":"2012-10-24T10:34:03.066358+0000","message":"handling event","event":{"client":{"name":"app02.live.production","address":"94.236.40.237","subscriptions":["all","app_db","nginx","unicorn"],"environment":"production","timestamp":1351074830},"check":{"notification":"IOwait too high","handler":"default","command":"/etc/sensu/nagios-extra/check_cpu_stats.sh -w 25 -c 40","interval":60,"subscribers":["all"],"low_flap_threshold":5,"occurrences":2,"refresh":60,"high_flap_threshold":20,"name":"iowait_check","issued":1351074840,"output":"CPU STATISTICS OK : user=0.51% system=0.76% iowait=0.00% idle=98.74% nice=0.00% steal=0.00% | CpuUser=0.51;CpuSystem=0.76;CpuIoWait=0.00;CpuIdle=98.74;CpuNice=0.00;CpuSteal=0.00;25;40\n","status":0,"duration":2.112,"history":["0","0","0","0","0","0","0","0","0","1","0","0","0","0","0","0","0","0","1","1","0"]},"occurrences":2,"action":"resolve"},"handler":{"command":"/etc/sensu/handlers/mailer.rb","type":"pipe","name":"email"},"level":"info"}