bin/check-sqs-messages.rb in sensu-plugins-aws-0.0.1.alpha.2 vs bin/check-sqs-messages.rb in sensu-plugins-aws-0.0.1
- old
+ new
@@ -25,14 +25,16 @@
# Copyright (c) 2013, Justin Lambert <jlambert@letsevenup.com>
# Released under the same terms as Sensu (the MIT license); see LICENSE
# for details.
#
-require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-plugin/check/cli'
require 'aws-sdk'
+#
+# Check SQS Messages
+#
class SQSMsgs < Sensu::Plugin::Check::CLI
option :aws_access_key,
short: '-a AWS_ACCESS_KEY',
long: '--aws-access-key AWS_ACCESS_KEY',
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY_ID'] or provide it as an option",
@@ -86,9 +88,10 @@
def aws_config
hash = {}
hash.update access_key_id: config[:aws_access_key], secret_access_key: config[:aws_secret_access_key]\
if config[:aws_access_key] && config[:aws_secret_access_key]
+ hash.update region: config[:aws_region]
hash
end
def run
AWS.config aws_config