flapjack 1.3.0rc2 → 1.3.0rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a93d8f0d691ce0742f2957abd0d171652bd525c
4
- data.tar.gz: ef1e19c328fad3675b27bf0e20dff95f12070025
3
+ metadata.gz: 3a99054ee2b384d5e9c228122908ccf56025729a
4
+ data.tar.gz: 9f460d85068057cf8063ebce88c199470efe8c91
5
5
  SHA512:
6
- metadata.gz: 41ca70ac49c6eaf26b4adebc0b4eb0ef2190c1ae2620ff23d7442e282112817d85ba7fbba2554f6e6a3808f995ff85e35bcfe06bc8c8e6a08cb270276dcecbda
7
- data.tar.gz: c0a0c02ab9c3336f3265b4c4a18c985e074e9c1d43174dea06cac81ae6700315b693835b4d982828ce02b6a5b41ea321b66166b671306ccff9c834c8e3af78e2
6
+ metadata.gz: 80ecfea159a7b1267f1288f32a2c672da1d73519fa9befc25299915eb786e24f577928737c05f04f339ac4eb00fbdc7312dcb64596c66c127a39fc0099125d18
7
+ data.tar.gz: d84a6a4b1cc227717f1b2b3ed91699d2908f4de32e44eab6f576b64cd5224e4fba189bed5341764d518a0dad2b1326b4b5eef568b718328ec6c13437b6f5608e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Flapjack Changelog
2
2
 
3
+ # 1.3.0rc3 - 2015-02-17
4
+ - Bug: cleanup gateway shutdown logic, fix #789 #790 (@ali-graham)
5
+ - Chore: move init scripts to omnibus-flapjack repo (@Hobbsee)
6
+
3
7
  # 1.3.0rc2 - 2015-02-13
4
8
  - Bug: Error uninstalling - Error generating or dispatching SMS Nexmo message #789 (@Hobbsee)
5
9
 
@@ -130,6 +130,7 @@ module Flapjack
130
130
  end
131
131
  return nil
132
132
  end
133
+ return if 'shutdown'.eql?(parsed['notification_type'])
133
134
  self.new( parsed, :logger => opts[:logger] )
134
135
  end
135
136
 
@@ -138,6 +138,7 @@ module Flapjack
138
138
  def self.parse_and_validate(raw, opts = {})
139
139
  errors = []
140
140
  if parsed = ::Flapjack.load_json(raw)
141
+ return if 'noop'.eql?(parsed['type'])
141
142
  if parsed.is_a?(Hash)
142
143
  errors = validation_errors_for_hash(parsed, opts)
143
144
  else
@@ -205,7 +205,7 @@ module Flapjack
205
205
 
206
206
  return if redis.exists('validated_scheduled_maintenance_periods')
207
207
 
208
- Flapjack::Data::EntityCheck.all(:redis => redis).select {|ec|
208
+ Flapjack::Data::EntityCheck.all(:redis => redis).compact.select {|ec|
209
209
  ec.in_scheduled_maintenance?
210
210
  }.each do |check|
211
211
  check.update_current_scheduled_maintenance(:revalidate => true)
@@ -85,8 +85,9 @@ module Flapjack
85
85
  if options[:logger]
86
86
  options[:logger].warn("Error deserialising notification json: #{e}, raw json: #{raw.inspect}")
87
87
  end
88
- return nil
88
+ return
89
89
  end
90
+ return if 'shutdown'.eql?(parsed['type'])
90
91
  self.new( parsed )
91
92
  end
92
93
 
@@ -45,7 +45,8 @@ module Flapjack
45
45
  until @should_quit
46
46
  begin
47
47
  @logger.debug("aws_sns gateway is going into blpop mode on #{queue}")
48
- deliver( Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger) )
48
+ alert = Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger)
49
+ deliver(alert) unless alert.nil?
49
50
  rescue => e
50
51
  @logger.error "Error generating or dispatching AWS SNS message: #{e.class}: #{e.message}\n" +
51
52
  e.backtrace.join("\n")
@@ -51,7 +51,8 @@ module Flapjack
51
51
  until @should_quit
52
52
  begin
53
53
  @logger.debug("email gateway is going into blpop mode on #{queue}")
54
- deliver( Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger) )
54
+ alert = Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger)
55
+ deliver(alert) unless alert.nil?
55
56
  rescue => e
56
57
  @logger.error "Error generating or dispatching email message: #{e.class}: #{e.message}\n" +
57
58
  e.backtrace.join("\n")
@@ -45,7 +45,8 @@ module Flapjack
45
45
  until @should_quit
46
46
  begin
47
47
  @logger.debug("sms_messagenet gateway is going into blpop mode on #{queue}")
48
- deliver( Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger) )
48
+ alert = Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger)
49
+ deliver(alert) unless alert.nil?
49
50
  rescue => e
50
51
  @logger.error "Error generating or dispatching SMS Messagenet message: #{e.class}: #{e.message}\n" +
51
52
  e.backtrace.join("\n")
@@ -45,7 +45,8 @@ module Flapjack
45
45
  until @should_quit
46
46
  begin
47
47
  @logger.debug("sms_nexmo gateway is going into blpop mode on #{queue}")
48
- deliver( Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger) )
48
+ alert = Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger)
49
+ deliver(alert) unless alert.nil?
49
50
  rescue => e
50
51
  @logger.error "Error generating or dispatching SMS Nexmo message: #{e.class}: #{e.message}\n" +
51
52
  e.backtrace.join("\n")
@@ -49,7 +49,8 @@ module Flapjack
49
49
  until @should_quit
50
50
  begin
51
51
  @logger.debug("sms_twilio gateway is going into blpop mode on #{queue}")
52
- deliver( Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger) )
52
+ alert = Flapjack::Data::Alert.next(queue, :redis => @redis, :logger => @logger)
53
+ deliver(alert) unless alert.nil?
53
54
  rescue => e
54
55
  @logger.error "Error generating or dispatching SMS Twilio message: #{e.class}: #{e.message}\n" +
55
56
  e.backtrace.join("\n")
@@ -66,7 +66,7 @@ module Flapjack
66
66
  notification = Flapjack::Data::Notification.next(@notifications_queue,
67
67
  :redis => @redis,
68
68
  :logger => @logger)
69
- process_notification(notification) unless notification.nil? || (notification.type == 'shutdown')
69
+ process_notification(notification) unless notification.nil?
70
70
  end
71
71
 
72
72
  @logger.info("Exiting main loop.")
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module Flapjack
4
- VERSION = "1.3.0rc2"
4
+ VERSION = "1.3.0rc3"
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0rc2
4
+ version: 1.3.0rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-02-13 00:00:00.000000000 Z
14
+ date: 2015-02-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: dante
@@ -387,9 +387,6 @@ files:
387
387
  - Rakefile
388
388
  - bin/flapjack
389
389
  - build.sh
390
- - dist/etc/init.d/flapjack
391
- - dist/etc/init.d/flapjack-nagios-receiver
392
- - dist/etc/init.d/flapper
393
390
  - etc/flapjack_config.yaml.example
394
391
  - features/ack_after_sched_maint.feature
395
392
  - features/cli.feature
@@ -1,32 +0,0 @@
1
- #!/bin/bash
2
-
3
- ### BEGIN INIT INFO
4
- # Provides: flapjack
5
- # Required-Start: $syslog $remote_fs redis-flapjack
6
- # Required-Stop: $syslog $remote_fs redis-flapjack
7
- # Should-Start: $local_fs
8
- # Should-Stop: $local_fs
9
- # Default-Start: 2 3 4 5
10
- # Default-Stop: 0 1 6
11
- # Short-Description: flapjack - scalable monitoring notification system
12
- # Description: flapjack - scalable monitoring notification system
13
- ### END INIT INFO
14
-
15
- # Copyright (c) 2009-2013 Lindsay Holmwood <lindsay@holmwood.id.au>
16
- #
17
- # Boots flapjack (coordinator, processor, notifier, gateways...)
18
-
19
- PATH=/opt/flapjack/bin:$PATH
20
-
21
- if [ ! $(which flapjack) ]; then
22
- echo "Error: flapjack isn't in PATH."
23
- echo "Refusing to do anything!"
24
- exit 1
25
- fi
26
-
27
- # Evaluate command
28
- flapjack server $@
29
-
30
- RETVAL=$?
31
- exit $RETVAL
32
-
@@ -1,21 +0,0 @@
1
- #!/bin/bash
2
- #
3
- # Copyright (c) 2009-2013 Lindsay Holmwood <lindsay@holmwood.id.au>
4
- #
5
- # flapjack-nagios-receiver
6
- # reads from a nagios perfdata named-pipe and submits each event to the events queue in redis
7
- #
8
-
9
- PATH=/opt/flapjack/bin:$PATH
10
-
11
- if [ ! $(which flapjack) ]; then
12
- echo "Error: flapjack isn't in PATH."
13
- echo "Refusing to do anything!"
14
- exit 1
15
- fi
16
-
17
- # Evaluate command
18
- flapjack receiver nagios $1 --daemonize
19
-
20
- RETVAL=$?
21
- exit $RETVAL
@@ -1,18 +0,0 @@
1
- #!/bin/bash
2
- #
3
- # flapper
4
- #
5
-
6
- PATH=/opt/flapjack/bin:$PATH
7
-
8
- if [ ! $(which flapjack) ]; then
9
- echo "Error: flapjack isn't in PATH."
10
- echo "Refusing to do anything!"
11
- exit 1
12
- fi
13
-
14
- # Evaluate command
15
- flapjack flapper $1
16
-
17
- RETVAL=$?
18
- exit $RETVAL