riemann-aws 0.1.3 → 0.1.4

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: 199a0f07d158b41eb67f84586294c9814d5b5681
4
- data.tar.gz: 0d7f7526f9dac21f0b9197c610861bc4a2f82490
3
+ metadata.gz: 37695dfc59446cc30f7cec56a94367969031265b
4
+ data.tar.gz: 5e7cbfece2ce15ecfa723d47fae31ef1da35b357
5
5
  SHA512:
6
- metadata.gz: fb5e093683424c54ebb2c52183a9770e40346cfadfbcdf566b2535e5acd575a6fc1f7c53119248810697568b9461dfb8f0e7c0ad9c869d2e9e1dfebbc5feb6bc
7
- data.tar.gz: 0bceced5e54574f926ffd8449196f2bafafb083d7803361e330f513167ea73289344da2dd43fb568cd33319efb794d1ab84d2371450d0cb67f827cfea9e3181b
6
+ metadata.gz: 946250c9caefa65b370c8b5caebcbf14279f05631d89d4dcb1f3947d92df6a185d8ab107289437aed588a0f2b8966fdb783461f5053a117aec1649b328833e10
7
+ data.tar.gz: c13fcfca6bf0105600202ff3e0116625c5f93ced44736f555eae92839c14915d8ded99278611f1fd94d18c69e9119f487a73cf7b125e2d75475839d44758bbf1
@@ -34,9 +34,9 @@ class Riemann::Tools::AWSBilling
34
34
  creds = { :use_iam_profile => true }
35
35
  end
36
36
  @cloudwatch = Fog::AWS::CloudWatch.new(creds)
37
- @start_time = (Time.now.utc - opts[:time_start]).iso8601
38
- @end_time = (Time.now.utc - opts[:time_end]).iso8601
39
37
  end
38
+ @start_time = (Time.now.utc - opts[:time_start]).iso8601
39
+ @end_time = (Time.now.utc - opts[:time_end]).iso8601
40
40
  end
41
41
 
42
42
  def tick
@@ -14,7 +14,7 @@ class Riemann::Tools::S3Metrics
14
14
  opt :aws_access, "AWS Access Key", :type => String
15
15
  opt :aws_secret, "AWS Secret Key", :type => String
16
16
  opt :aws_region, "AWS Region", :type => String, :default => "eu-west-1"
17
- opt :buckets, "Buckets to pull metrics from, multi=true", :type => String, :multi => true, :required => true
17
+ opt :buckets, "Buckets to pull metrics from, multi=true, can have a prefix like mybucket/prefix", :type => String, :multi => true, :required => true
18
18
  opt :max_objects, "Max number of objects to list before stopping to save bandwidth", :default => -1
19
19
 
20
20
 
@@ -40,21 +40,25 @@ class Riemann::Tools::S3Metrics
40
40
  end
41
41
  end
42
42
 
43
- options[:buckets].each do |bucket|
44
-
45
- directory = connection.directories.get(bucket)
43
+ options[:buckets].each do |url|
44
+ split = url.split('/')
45
+ bucket = split[0]
46
+ prefix = ""
47
+ if (split[1])
48
+ prefix = url[(split[0].length+1)..-1]
49
+ end
46
50
  count = 0
47
- directory.files.each do |file|
51
+ connection.directories.get(bucket, prefix: prefix).files.map do |file|
48
52
  count = count +1
49
53
  if (options[:max_objects]>0 && count>options[:max_objects])
50
54
  break
51
55
  end
52
56
  end
53
57
  if (options[:max_objects]>0 && count>options[:max_objects])
54
- event = event(bucket, "objectCount", count, "count was bigger than threshold #{options[:max_objects]}", "warning")
58
+ event = event(url, "objectCount", count, "count was bigger than threshold #{options[:max_objects]}", "warning")
55
59
  report(event)
56
60
  else
57
- event = event(bucket, "objectCount", count, "All objects counted, threshold=#{options[:max_objects]}", "ok")
61
+ event = event(url, "objectCount", count, "All objects counted, threshold=#{options[:max_objects]}", "ok")
58
62
  report(event)
59
63
  end
60
64
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kingsbury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riemann-tools
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.11
19
+ version: 0.2.13
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.11
26
+ version: 0.2.13
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fog
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -55,13 +55,13 @@ dependencies:
55
55
  description:
56
56
  email: aphyr@aphyr.com
57
57
  executables:
58
- - riemann-aws-billing
58
+ - riemann-s3-list
59
+ - riemann-s3-status
60
+ - riemann-elb-metrics
59
61
  - riemann-aws-rds-status
60
62
  - riemann-aws-sqs-status
63
+ - riemann-aws-billing
61
64
  - riemann-aws-status
62
- - riemann-elb-metrics
63
- - riemann-s3-list
64
- - riemann-s3-status
65
65
  extensions: []
66
66
  extra_rdoc_files: []
67
67
  files:
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project: riemann-aws
97
- rubygems_version: 2.5.2
97
+ rubygems_version: 2.6.13
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Submits AWS stats to riemann.