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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb30066421e308022d06fc05ff455ce9a399bf8d
4
- data.tar.gz: e1cf21306197c7b0e1eed6493b58b93e1b5ddcf9
3
+ metadata.gz: 52529feb511cde3ec602078341a19d2d09060562
4
+ data.tar.gz: a672846b2ddea694e1f1b23fc9aa632629dfc131
5
5
  SHA512:
6
- metadata.gz: 139b276a174075928ecd7a495e7ffac36dd554dabf9b1198ca00fb3d5a7c7acd20aca3f03d57b316360e29f5117b7efcb2aa34ae81659b9e825425f10a4c35fc
7
- data.tar.gz: 583b0a56837a75a046f2950c6187498d4411e6de376e5dc9004fca93b57387179c7cd90a69d8fcf51285456ffd40526592ff83e8f5141066f0b1dba64fa4732c
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.
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2012 Sourcefire, Inc.
2
2
 
3
3
  module Panoptimon
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/panoptimon.gemspec CHANGED
@@ -29,5 +29,4 @@ Gem::Specification.new do |gem|
29
29
 
30
30
  # Collector gem dependencies
31
31
  gem.add_dependency 'sys-filesystem'
32
- gem.add_dependency 'mysql'
33
32
  end
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.1.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
@@ -1,4 +0,0 @@
1
- {
2
- "description" : "mysql status and slave status collector. Config must provide some valid combination of hostname,username,password,database,port,socket to connect.",
3
- "socket" : "/tmp/mysql.socket"
4
- }