riemann-aws-dynamodb 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/riemann-aws-dynamodb +16 -3
- data/riemann-aws-dynamodb.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34cd73b6d0d8f8ede15b4439662dbda0030b59bf
|
4
|
+
data.tar.gz: e29e08b94c46c71d10f8804d51f0e4a9357dc0d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3956d8962ebc5224cd1ef1bb325a2316acb148b1d916dfa3e15d0d062674667c4ca50b10a57629bb3a86508f844004bd35417ac4324e6b6753e948a395c8387
|
7
|
+
data.tar.gz: 7d31d5d48db74b874e07fe05f6b9ec236f8c067a293c73ee8589303cdc6716c4abbdbf008741c365ab234d68fe33cb39d775c2e4ef582b85f404935bd58ab144
|
data/bin/riemann-aws-dynamodb
CHANGED
@@ -12,20 +12,24 @@ class Riemann::Tools::AwsDynamoDB
|
|
12
12
|
opt :access_key, "AWS access key", :type => String
|
13
13
|
opt :secret_key, "Secret access key", :type => String
|
14
14
|
opt :region, "AWS region", :type => String, :default => 'us-east-1'
|
15
|
-
opt :
|
15
|
+
opt :only_table, "Only monitor this table. Can specify multiple times.", :type => String, :multi => true
|
16
|
+
opt :ign_table, "Don't monitor this table. Can specify multiple times.", :type => String, :multi => true
|
16
17
|
# opt :metric, "Metric names with comma-separated warning/critical thresholds (eg., 'CPUUtilization,50,90'). Multiple tuples can be set.", :type => String, :multi => true
|
17
18
|
|
18
19
|
def initialize
|
19
|
-
|
20
|
-
@
|
20
|
+
@only_tables = opts.fetch(:only_table)
|
21
|
+
@ign_tables = opts.fetch(:ign_table)
|
22
|
+
|
21
23
|
if opts.has_key?('access_key') and opts.has_key?('secret_key')
|
22
24
|
creds = { :aws_access_key_id => opts[:access_key],
|
23
25
|
:aws_secret_access_key => opts[:secret_key] }
|
24
26
|
else
|
25
27
|
creds = { :use_iam_profile => true }
|
26
28
|
end
|
29
|
+
|
27
30
|
creds['region'] = opts[:region]
|
28
31
|
@cloudwatch = Fog::AWS::CloudWatch.new(creds)
|
32
|
+
@dynamodb = Fog::AWS::DynamoDB.new(creds)
|
29
33
|
end
|
30
34
|
|
31
35
|
def metrics_opts
|
@@ -39,6 +43,15 @@ class Riemann::Tools::AwsDynamoDB
|
|
39
43
|
|
40
44
|
def tick
|
41
45
|
time = Time.new
|
46
|
+
ddb = @dynamodb.list_tables
|
47
|
+
@tables = ddb[:body]["TableNames"]
|
48
|
+
|
49
|
+
if opts[:only_table_given]
|
50
|
+
@tables &= @only_tables
|
51
|
+
elsif opts[:ign_table_given]
|
52
|
+
@tables -= @ign_tables
|
53
|
+
end
|
54
|
+
|
42
55
|
@tables.each do |table_name|
|
43
56
|
metrics_opts.each_pair do |metric_name, opts|
|
44
57
|
result = @cloudwatch.get_metric_statistics({
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "riemann-aws-dynamodb"
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.4'
|
8
8
|
spec.authors = ["Fernando Alonso"]
|
9
9
|
spec.email = ["krakatoa1987@gmail.com"]
|
10
10
|
spec.summary = %q{Riemann agent to collect Aws DynamoDB metrics}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riemann-aws-dynamodb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Alonso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riemann-tools
|