Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The occurrences parameter on the check does not work as it should..I'm getting spammed with emails because the default occurrences is 1. Even if i change it to 20 i still get an email for every critical occurrence. I checked sense-client and server logs but nothing which would tell me the reason why this is happening.
- sensu-client.log
- {"timestamp":"2014-10-23T17:04:32.091165-0400","level":"info","message":"publishing check result","payload":{"client":"sensu-client-2","check":{"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 ","interval":60,"standalone":true,"handlers":["mail"],"occurrences":20,"refresh":100,"name":"cron_check","issued":1414098271,"executed":1414098271,"duration":0.114,"output":"CheckProcs CRITICAL: Found 0 matching processes; cmd /crond/\n","status":2}}}
- sensu-server.log
- {"timestamp":"2014-10-23T17:02:49.123269-0400","level":"info","message":"handling event","event":{"id":"26257519-71d2-4859-b0bd-da3fcbdfb449","client":{"name":"sensu-client-2","address":"10.199.8.13","subscriptions":["all"],"version":"0.13.1","timestamp":1414098270},"check":{"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 ","interval":60,"standalone":true,"handlers":["mail"],"occurrences":20,"refresh":100,"name":"cron_check","issued":1414098271,"executed":1414098271,"duration":0.114,"output":"CheckProcs CRITICAL: Found 0 matching processes; cmd /crond/\n","status":2,"history":["0","0","2","2","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","2"]},"occurrences":1,"action":"create"},"handler":{"type":"pipe","command":"mail -s 'sensu-alert' akshay.anilkapoor@ruckuswireless.com","severities":["critical"],"name":"mail"}}
- {"timestamp":"2014-10-23T17:02:54.847716-0400","level":"info","message":"determining stale clients"}
- {"timestamp":"2014-10-23T17:02:57.525943-0400","level":"info","message":"publishing check request","payload":{"name":"cpu_check","issued":1414098177,"command":"/etc/sensu/plugins/memory-metrics.rb"},"subscribers":["cpu"]}
- {"timestamp":"2014-10-23T17:03:04.993603-0400","level":"info","message":"pruning aggregations"}
- {"timestamp":"2014-10-23T17:03:07.529663-0400","level":"info","message":"publishing check request","payload":{"name":"cpu_check","issued":1414098187,"command":"/etc/sensu/plugins/memory-metrics.rb"},"subscribers":["cpu"]}
- {"timestamp":"2014-10-23T17:03:17.532337-0400","level":"info","message":"publishing check request","payload":{"name":"cpu_check","issued":1414098197,"command":"/etc/sensu/plugins/memory-metrics.rb"},"subscribers":["cpu"]}
- {"timestamp":"2014-10-23T17:03:24.851117-0400","level":"info","message":"determining stale clients"}
- {"timestamp":"2014-10-23T17:03:24.994703-0400","level":"info","message":"pruning aggregations"}
- {"timestamp":"2014-10-23T17:03:27.534657-0400","level":"info","message":"publishing check request","payload":{"name":"cpu_check","issued":1414098207,"command":"/etc/sensu/plugins/memory-metrics.rb"},"subscribers":["cpu"]}
- {"timestamp":"2014-10-23T17:03:37.537498-0400","level":"info","message":"publishing check request","payload":{"name":"cpu_check","issued":1414098217,"command":"/etc/sensu/plugins/memory-metrics.rb"},"subscribers":["cpu"]}
- {"timestamp":"2014-10-23T17:03:44.996150-0400","level":"info","message":"pruning aggregations"}
- {"timestamp":"2014-10-23T17:03:47.540493-0400","level":"info","message":"publishing check request","payload":{"name":"cpu_check","issued":1414098227,"command":"/etc/sensu/plugins/memory-metrics.rb"},"subscribers":["cpu"]}
- {"timestamp":"2014-10-23T17:03:49.122165-0400","level":"info","message":"handling event","event":{"id":"c9b9faf6-ce5a-4762-b47c-afe1e9d3b187","client":{"name":"sensu-client-2","address":"10.199.8.13","subscriptions":["all"],"version":"0.13.1","timestamp":1414098330},"check":{"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 ","interval":60,"standalone":true,"handlers":["mail"],"occurrences":20,"refresh":100,"name":"cron_check","issued":1414098331,"executed":1414098331,"duration":0.114,"output":"CheckProcs CRITICAL: Found 0 matching processes; cmd /crond/\n","status":2,"history":["0","2","2","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","2","2"]},"occurrences":2,"action":"create"},"handler":{"type":"pipe","command":"mail -s 'sensu-alert' akshay.anilkapoor@ruckuswireless.com","severities":["critical"],"name":"mail"}}
- --> Handler definition on the server handler_mail.json
- {
- "handlers": {
- "mail": {
- "type":"pipe",
- "command": "mail -s 'sensu-alert' a@b.com",
- "severities": [ "critical" ]
- }
- }
- }
- --> Check on the client
- {
- "checks": {
- "cron_check": {
- "command": "/etc/sensu/plugins/check-procs.rb -p crond -C 1 ",
- "interval": 60,
- "standalone": true,
- "handlers": [ "mail" ],
- "occurrences": 20,
- "refresh": 100
- }
- }
- }
- Thanks!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement