Skip to content

Commit 35d8fcd

Browse files
author
Brian Czapiga
committed
updated for 2.0.0
1 parent 251ddbe commit 35d8fcd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Gemfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
source 'https://rubygems.org'
1+
source 'http://rubygems.org'
22
gem 'redis'
3-
gem 'oj'
4-
gem 'json'
3+
gem 'flapjack'

flapjack.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
require 'json'
44
require 'optparse'
55
require 'redis'
6-
require 'oj'
6+
require 'flapjack'
7+
require 'flapjack/configuration'
8+
require 'flapjack/data/event'
79

810
options = {
911
host: '127.0.0.1',
@@ -49,8 +51,6 @@
4951
jsonInput = $stdin.read
5052
event = JSON.parse(jsonInput)
5153

52-
redis = Redis.new(options)
53-
5454
SEVERITIES = ['ok', 'warning', 'critical', 'unknown']
5555
client = event['client']
5656
check = event['check']
@@ -79,4 +79,6 @@
7979
tags: tags
8080
}
8181

82-
redis.lpush(options[:channel], Oj.dump(flapjack_event, :mode => :compat, :time_format => :ruby, :indent => 0))
82+
Flapjack::RedisProxy.config = options
83+
Flapjack::Data::Event.push(options[:channel], flapjack_event)
84+
Flapjack.redis.quit

0 commit comments

Comments
 (0)