sensu

Sensu mailer not respecting occurrences setting


I'm using the sensu-mailer handler to send email alerts. It works fine, expect for the fact that I cannot get it to send emails at every occurrence. No matter what value for occurrences I give, it doesn't change

# config

"ping_website": {
      "notification": "getpostman.com HTTP port 80",
      "command": "/etc/sensu/plugins/check-http.rb -u <url>",
      "subscribers": [ "base" ],
      "standalone": true,
      "interval": 60,
      "occurrences": 1,
      "handlers": ["default", "mailer"]
    }

# log

{"timestamp":"2015-03-01T05:40:44.233827+0000","level":"info","message":"handler output","handler":{"type":"pipe","command":"ruby /etc/sensu/handlers/mailer.rb","name":"mailer"},"output":"only handling every 30 occurrences: localhost/ping_website\n"}

Solution

  • Figured it out. Need to set refresh to a different value. Since the default value is 1800 seconds, another alert won't be sent for another 30 consecutive occurrences of the error. Setting refresh to a lower number fixed the problem.