riemann-redis-keys 0.1.0 → 0.1.1
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.
- data/README.md +9 -0
- data/bin/riemann-redis-keys +14 -1
- metadata +18 -12
- checksums.yaml +0 -7
data/README.md
CHANGED
@@ -27,3 +27,12 @@ Specify additional conneciton info:
|
|
27
27
|
```
|
28
28
|
riemann-redis-keys --redis-key "other:key" --redis-url "redis://localhost:6379"
|
29
29
|
```
|
30
|
+
|
31
|
+
### Thresholds
|
32
|
+
|
33
|
+
The riemann state field can be controlled by setting thresholds for critical
|
34
|
+
and warning. Default value is "ok"
|
35
|
+
|
36
|
+
```
|
37
|
+
riemann-redis-keys --redis-key "test:key" --warning 3 --critical 5
|
38
|
+
```
|
data/bin/riemann-redis-keys
CHANGED
@@ -13,6 +13,10 @@ class Riemann::Tools::RedisKeys
|
|
13
13
|
opt :redis_section, "Redis INFO section", :type => String, :multi => true, :default => 'default'
|
14
14
|
opt :redis_key, "Redis keys", :type => :strings, :multi => true
|
15
15
|
|
16
|
+
# Thresholds
|
17
|
+
opt :warning, "Warning threshold", :type => Integer
|
18
|
+
opt :critical, "Critital threshold", :type => Integer
|
19
|
+
|
16
20
|
def initialize
|
17
21
|
options = if opts[:redis_url] != ''
|
18
22
|
{ :url => opts[:redis_url] }
|
@@ -44,14 +48,23 @@ class Riemann::Tools::RedisKeys
|
|
44
48
|
if !type.nil?
|
45
49
|
value = @redis.send(@key_operations[type], key)
|
46
50
|
|
51
|
+
state = "ok"
|
52
|
+
[:warning, :critical].each do |threshold|
|
53
|
+
if !opts[threshold].nil? && value > opts[threshold]
|
54
|
+
state = threshold.to_s
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
47
58
|
data = {
|
48
59
|
:host => opts[:redis_host].dup,
|
49
60
|
:service => "redis #{key}",
|
50
61
|
:metric => value.to_s,
|
51
|
-
:state =>
|
62
|
+
:state => state,
|
52
63
|
:tags => ['redis']
|
53
64
|
}
|
54
65
|
|
66
|
+
puts data
|
67
|
+
|
55
68
|
report(data)
|
56
69
|
end
|
57
70
|
end
|
metadata
CHANGED
@@ -1,41 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riemann-redis-keys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Stuart Quin
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: riemann-tools
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: 0.2.1
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 0.2.1
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: redis
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: 3.0.2
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: 3.0.2
|
41
46
|
description: Monitor redis key size/length and report back to riemann
|
@@ -45,30 +50,31 @@ executables:
|
|
45
50
|
extensions: []
|
46
51
|
extra_rdoc_files: []
|
47
52
|
files:
|
48
|
-
- README.md
|
49
53
|
- bin/riemann-redis-keys
|
54
|
+
- README.md
|
50
55
|
homepage: https://github.com/stuartquin/riemann-redis-keys
|
51
56
|
licenses:
|
52
57
|
- MIT
|
53
|
-
metadata: {}
|
54
58
|
post_install_message:
|
55
59
|
rdoc_options: []
|
56
60
|
require_paths:
|
57
61
|
- lib
|
58
62
|
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
59
64
|
requirements:
|
60
|
-
- -
|
65
|
+
- - ! '>='
|
61
66
|
- !ruby/object:Gem::Version
|
62
67
|
version: 1.8.7
|
63
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
64
70
|
requirements:
|
65
|
-
- -
|
71
|
+
- - ! '>='
|
66
72
|
- !ruby/object:Gem::Version
|
67
73
|
version: '0'
|
68
74
|
requirements: []
|
69
75
|
rubyforge_project: riemann-redis-keys
|
70
|
-
rubygems_version:
|
76
|
+
rubygems_version: 1.8.23
|
71
77
|
signing_key:
|
72
|
-
specification_version:
|
78
|
+
specification_version: 3
|
73
79
|
summary: Monitor redis key size/length and report back to riemann
|
74
80
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 9e193bd59d5f39b13696b800b9b418f899525138
|
4
|
-
data.tar.gz: 5e06097caf7379b93f32e32ab617e2207f8e7289
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: d354dccaef564b9593d6a9e6701c214baf1b2e85947fb9367bd48db9e5ff2042dff2461cfe3b9db651a54007ddaf28b9e85c6a863f6c168421dd23cbd212168b
|
7
|
-
data.tar.gz: 65747d838633a15cd8ba1416a77abedbc44a19e0b2757701efea816fa875a932275c0df7d55505897187807d4a494e9ac99643460bf87a32dda9c78b9212c03c
|