Skip to content

Commit

Permalink
Remove Hipchat support (#32)
Browse files Browse the repository at this point in the history
Hipchat has been discontinued
  • Loading branch information
eheydrick authored Dec 2, 2019
1 parent 6b376f7 commit 90dbd4d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Gem Version](https://badge.fury.io/rb/aws-cleaner.svg)](http://badge.fury.io/rb/aws-cleaner)

AWS Cleaner listens for EC2 termination events produced by AWS [CloudWatch Events](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchEvents.html)
and removes the instances from Chef. It can optionally remove the node from Sensu Monitoring (defaults true), fire off webhooks, and send notifications via Hipchat & Slack when actions occur.
and removes the instances from Chef. It can optionally remove the node from Sensu Monitoring (defaults true), fire off webhooks, and send notifications via Slack when actions occur.

![aws-cleaner](https://raw.github.com/eheydrick/aws-cleaner/master/aws-cleaner.png)

Expand Down
1 change: 0 additions & 1 deletion aws-cleaner.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Gem::Specification.new do |s|

s.add_runtime_dependency 'aws-sdk-sqs', '~> 1'
s.add_runtime_dependency 'chef-infra-api', '~> 0.9'
s.add_runtime_dependency 'hipchat', '~> 1.5'
s.add_runtime_dependency 'optimist', '~> 3.0'
s.add_runtime_dependency 'rest-client', '~> 2'
s.add_runtime_dependency 'slack-poster', '~> 2.2'
Expand Down
5 changes: 2 additions & 3 deletions bin/aws_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
# Listen for AWS CloudWatch Events EC2 termination events delivered via SQS
# and remove the node from Chef and Sensu and send a notification
# to Hipchat or Slack
# to Slack
#
# Copyright (c) 2015-2017 Eric Heydrick
# Copyright (c) 2015-2019 Eric Heydrick
# Licensed under The MIT License
#

Expand All @@ -16,7 +16,6 @@
require 'yaml'
require 'aws-sdk-sqs'
require 'chef-api'
require 'hipchat'
require 'rest-client'
require 'optimist'
require 'slack/poster'
Expand Down
4 changes: 0 additions & 4 deletions config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
:url: 'https://chef.example.com/organizations/example'
:client: 'somebody'
:key: '/path/to/client.pem'
:hipchat:
:api_token: 'Hipchat API token'
:room: 'Notifications'
:enable: false
:slack:
:webhook_url: 'https://hooks.slack.com/services/XXXXXXXX/YYYYYYY/ZZZZZZZZZZZZZZZZ'
:channel: '#notifications'
Expand Down
14 changes: 1 addition & 13 deletions lib/aws-cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,6 @@ def process_message(message_body)
end

module Notify
# notify hipchat
def self.notify_hipchat(msg, config)
hipchat = HipChat::Client.new(
config[:hipchat][:api_token],
api_version: 'v2'
)
room = config[:hipchat][:room]
hipchat[room].send('AWS Cleaner', msg)
end

# notify slack
def self.notify_slack(msg, config)
slack = Slack::Poster.new(config[:slack][:webhook_url])
Expand All @@ -136,9 +126,7 @@ def self.notify_slack(msg, config)

# generic chat notification method
def self.notify_chat(msg, config)
if config[:hipchat][:enable]
notify_hipchat(msg, config)
elsif config[:slack][:enable]
if config[:slack][:enable]
notify_slack(msg, config)
end
end
Expand Down

0 comments on commit 90dbd4d

Please sign in to comment.