panoptimon 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/panoptimon/version.rb +1 -1
- data/panoptimon.gemspec +0 -1
- metadata +1 -17
- data/collectors/mysql_status/mysql_status +0 -52
- data/collectors/mysql_status/mysql_status.json +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52529feb511cde3ec602078341a19d2d09060562
|
4
|
+
data.tar.gz: a672846b2ddea694e1f1b23fc9aa632629dfc131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cb1390a85c8037597ff699d5c1df7b38ff750b0356ad7c1a097f2ef86395dd1ba21470d83e63b139bcbcd202fb3fb87dedb6ed36019632fe101ab58b5b3ff1d
|
7
|
+
data.tar.gz: fee7c6f5b141321e96f58cf96087e69dc65d084a899a330c93afe82292b409556b788b034fefd51b4f40f772379f2100d2f16ccf36c7afbd2d1271044e30a879
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# 0.2.0
|
2
|
+
|
3
|
+
Removed the mysql_status collector from core to reduce gem dependencies.
|
4
|
+
It can now be found at https://github.com/synthesist/panoptimon-collector-mysql_status
|
5
|
+
|
1
6
|
# 0.1.0
|
2
7
|
|
3
8
|
Added functionality to search for executables in the PATH environment variable directories.
|
data/lib/panoptimon/version.rb
CHANGED
data/panoptimon.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panoptimon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Wilhelm
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: mysql
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '>='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - '>='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
97
|
description: The All-Seeing System Monitor Daemon
|
112
98
|
email: sysops@sourcefire.com
|
113
99
|
executables:
|
@@ -170,8 +156,6 @@ files:
|
|
170
156
|
- collectors/memcached/test-notes.txt
|
171
157
|
- collectors/memory/memory
|
172
158
|
- collectors/memory/memory.json
|
173
|
-
- collectors/mysql_status/mysql_status
|
174
|
-
- collectors/mysql_status/mysql_status.json
|
175
159
|
- collectors/network/network
|
176
160
|
- collectors/network/network.json
|
177
161
|
- collectors/nginx/README.md
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'mysql';
|
4
|
-
require 'json';
|
5
|
-
|
6
|
-
class String; def as_number # from perlfaq4
|
7
|
-
self =~ %r{\A[+-]?(?=\.?\d)\d*\.?\d*(?:[Ee][+-]?\d+)?\z} \
|
8
|
-
? (self =~ %r{[\.Ee]} ? self.to_f : self.to_i)
|
9
|
-
: nil
|
10
|
-
end; end
|
11
|
-
|
12
|
-
class Mysql_status
|
13
|
-
|
14
|
-
def self.get_status (db)
|
15
|
-
rs = db.query("SHOW STATUS")
|
16
|
-
h = {}
|
17
|
-
while( r = rs.fetch_row )
|
18
|
-
h[r[0].downcase] = r[1]
|
19
|
-
end
|
20
|
-
return h
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.get_slave_status (db)
|
24
|
-
rs = db.query('SHOW SLAVE STATUS')
|
25
|
-
h = rs.fetch_hash or return {}
|
26
|
-
raise "too many results" if rs.num_rows > 1
|
27
|
-
return Hash[* h.keys.map {|k| [k.downcase, h[k]]}.flatten]
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.run (config)
|
31
|
-
db = Mysql.new(*
|
32
|
-
%w{hostname username password database port socket}.
|
33
|
-
map {|k| config[k]})
|
34
|
-
|
35
|
-
m = get_status(db)
|
36
|
-
m.merge(get_slave_status(db))
|
37
|
-
info = {}
|
38
|
-
m.keys.each {|k|
|
39
|
-
n = m[k].as_number
|
40
|
-
if n
|
41
|
-
m[k] = n
|
42
|
-
else
|
43
|
-
info[k] = m.delete(k)
|
44
|
-
end
|
45
|
-
}
|
46
|
-
m[:_info] = info if info.length > 0
|
47
|
-
puts JSON::generate(m)
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
Mysql_status.run(JSON::parse(ARGV[0])) if __FILE__ == $0
|