riemann-mongodb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE +21 -0
  3. data/README.md +14 -0
  4. data/bin/riemann-mongodb +39 -0
  5. metadata +88 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzAxZjY5OWY2YTA4NTM0MTgxZDViYTQ2MzZmNmMxYzE4ZjEwZTFmZg==
5
+ data.tar.gz: !binary |-
6
+ YTZkNDQ2Y2EzMjFjMDZhYTcyYzMxZTY5ZGRlZThkZTBjZTA2MzRiNg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NzRkYzhlZmMxZWUxNzkzYzExZmRlZTQzNTkyZmEwNzM4MjRjMzllNzVlZWYy
10
+ OTNlMjgzZTFjZDQ3YmNlMjM2NmI2M2I1NjBhOWFjOGUxMDBiN2U3YTcwMTc5
11
+ MWE2Y2I5OGRiZjg0YmQ1Y2E2OTM4MzQyYWYwM2Y1OGIwYjc4NTU=
12
+ data.tar.gz: !binary |-
13
+ ZWQ2YTFlMjNhYmQxYzk2NTU5M2E3MGU4ZmRiZWMyMjJkNDY2MTMwOWE5YjI2
14
+ OWU1Y2Y0YjU0NTgwYWI5ZDE0N2EzMDBiZGUxOTgxZmZmYTg1MmMxNjBmYWM0
15
+ YjM5OWRiNzIxZWQ3MzgyMzgwNmZiNDU0YzNkOTlhMDVmOTJjYjQ=
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2011 Kyle Kingsbury
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,14 @@
1
+ Riemann MongoDB
2
+ =============
3
+
4
+ Simple mongodb riemann client.
5
+
6
+ Submits the result of db.stats() query into riemann.
7
+
8
+ Get started
9
+ ==========
10
+
11
+ ``` bash
12
+ gem install riemann-mongodb
13
+ riemann-mongodb --help
14
+ ```
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Gathers MongoDB db.stats() and submits them to Riemann.
4
+
5
+ require 'riemann/tools'
6
+
7
+ class Riemann::Tools::Mongo
8
+ include Riemann::Tools
9
+ require 'mongo'
10
+
11
+ opt :mongo_host, "Mongo hostname", :default => 'localhost'
12
+ opt :mongo_port, "Mongo port", :default => 27017
13
+ opt :mongo_password, "Mongo password", :default => ''
14
+ opt :mongo_db, "Mongo database", :default => ''
15
+
16
+ def initialize
17
+ @db = ::Mongo::MongoClient.new(opts[:mongo_host], opts[:mongo_port]).db(opts[:mongo_db])
18
+ end
19
+
20
+ def tick
21
+ begin
22
+ @db.stats.each do |property, value|
23
+ data = {
24
+ :host => opts[:mongo_host].dup,
25
+ :service => "mongodb #{property}",
26
+ :metric => value.to_s,
27
+ :state => value.to_s,
28
+ :tags => ['mongodb']
29
+ }
30
+
31
+ report(data)
32
+ end
33
+ end
34
+
35
+ end
36
+
37
+ end
38
+
39
+ Riemann::Tools::Mongo.run
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: riemann-mongodb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Fede Borgnia
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: riemann-tools
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.2.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: mongo
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.10.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 1.10.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bson_ext
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 1.10.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 1.10.0
55
+ description:
56
+ email: fborgnia@gmail.com
57
+ executables:
58
+ - riemann-mongodb
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - bin/riemann-mongodb
63
+ - LICENSE
64
+ - README.md
65
+ homepage: https://github.com/riemann/riemann-mongodb
66
+ licenses: []
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: 1.8.7
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project: riemann-mongodb
84
+ rubygems_version: 2.1.11
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: MongoDB client that submits statistics to Riemann.
88
+ test_files: []