riemann-mysql 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE +21 -0
- data/README.md +5 -0
- data/bin/riemann-mysql +40 -0
- metadata +74 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ODUyYTI4NmQ5MmYwNzA2Mjc2MWQ4YjQ4YzhmYzYwYTM5NTYxNjNkMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NTAzOTBmNGVmOTM1ZWVkYzI0NjA5YjJjMTM5NGZjNTVmZjI2N2YzNg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OGQ2NmY2YTFlNjFlODMzN2JjZjYzMGYzY2E0NGYxZjJhMWQyZmJiYzZkZWIz
|
10
|
+
ZDBlN2JkMTI4NmFiYzUyN2Q1MWRhYzUzYzU2ODc3YjdiMWQ4YmU2OGFiNzZj
|
11
|
+
MzNmOGRiZWVlNjRlYzIzMjkzZTliNGFiN2RlMGZkNzgzNDk4Nzc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YWNkZDgwNGI0OTkwOWNlNWQ2NGZkN2RkMjFjN2VhMGM0ZjE2NDBiMzM4NGI3
|
14
|
+
YjgwZDQyN2QwODhiZjY5ZWUwNjdlMWFiNzc5ODczNDQzZmI0NzVjZmUzMWYz
|
15
|
+
ZDJlYzdiY2M3Y2FhZjVhNDY2NTE5MzZmMjJmY2Q1OTUxNzQ1YjM=
|
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
data/bin/riemann-mysql
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Gathers mysql STATUS and submits them to Riemann.
|
4
|
+
|
5
|
+
require 'riemann/tools'
|
6
|
+
|
7
|
+
class Riemann::Tools::Mysql
|
8
|
+
require 'mysql2'
|
9
|
+
include Riemann::Tools
|
10
|
+
|
11
|
+
opt :mysql_host, "MySQL hostname", :default => 'localhost'
|
12
|
+
opt :mysql_port, "MySQL port", :default => 3306
|
13
|
+
opt :mysql_username, "MySQL username", :default => ''
|
14
|
+
opt :mysql_password, "MySQL password", :default => ''
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
options = { :host => opts[:mysql_host],
|
18
|
+
:port => opts[:mysql_port],
|
19
|
+
:username => opts[:mysql_username],
|
20
|
+
:password => opts[:mysql_password] }
|
21
|
+
@mysql = ::Mysql2::Client.new(options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def tick
|
25
|
+
begin
|
26
|
+
@mysql.query("SHOW STATUS;").each do |var|
|
27
|
+
data = {
|
28
|
+
:host => opts[:mysql_host],
|
29
|
+
:service => "mysql #{var["Variable_name"]}",
|
30
|
+
:metric => var["Value"],
|
31
|
+
:tags => ["mysql"]
|
32
|
+
}
|
33
|
+
report(data)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
Riemann::Tools::Mysql.run
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: riemann-mysql
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Fede Borgnia
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-10 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.1.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mysql2
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.3.13
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.13
|
41
|
+
description:
|
42
|
+
email: fborgnia@gmail.com
|
43
|
+
executables:
|
44
|
+
- riemann-mysql
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- bin/riemann-mysql
|
49
|
+
- LICENSE
|
50
|
+
- README.md
|
51
|
+
homepage: https://github.com/riemann/riemann-mysql
|
52
|
+
licenses: []
|
53
|
+
metadata: {}
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options: []
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.8.7
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project: riemann-mysql
|
70
|
+
rubygems_version: 2.0.5
|
71
|
+
signing_key:
|
72
|
+
specification_version: 4
|
73
|
+
summary: MySQL client that submit events to Riemann.
|
74
|
+
test_files: []
|