riemann-babbler 0.9.2 → 0.9.3

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.
@@ -87,7 +87,11 @@ module Riemann
87
87
 
88
88
  # не запускаем плагин есть
89
89
  def run_plugin
90
- true
90
+ if plugin.run.nil?
91
+ true
92
+ else
93
+ plugin.run == true ? true : false
94
+ end
91
95
  end
92
96
 
93
97
  # Переодически вызываемое действие
@@ -0,0 +1,15 @@
1
+ class Riemann::Babbler::Netstat < Riemann::Babbler
2
+
3
+ def init
4
+ plugin.set_default(:service, 'netstat')
5
+ plugin.set_default(:interval, 60)
6
+ plugin.set_default(:port, 80)
7
+ #plugin.states.set_default(:warning, 300)
8
+ #plugin.states.set_default(:critical, 400)
9
+ end
10
+
11
+ def collect
12
+ count = shell("netstat -nat4 | egrep -e ':#{plugin.port}\s' | grep ESTA | wc -l").to_i
13
+ {:service => "#{plugin.service} tcp #{plugin.port}", :metric => count, :description => "count established connects: #{count} to port #{plugin.port}"}
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '0.9.2'
3
+ VERSION = '0.9.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-babbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-07 00:00:00.000000000 Z
12
+ date: 2013-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riemann-client
@@ -169,6 +169,7 @@ files:
169
169
  - lib/riemann/babbler/plugins/megacli.rb
170
170
  - lib/riemann/babbler/plugins/memory.rb
171
171
  - lib/riemann/babbler/plugins/net.rb
172
+ - lib/riemann/babbler/plugins/netstat.rb
172
173
  - lib/riemann/babbler/plugins/nginx.rb
173
174
  - lib/riemann/babbler/plugins/runit.rb
174
175
  - lib/riemann/version.rb
@@ -189,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
190
  version: '0'
190
191
  segments:
191
192
  - 0
192
- hash: 2173667543562189503
193
+ hash: 2125100952361117085
193
194
  required_rubygems_version: !ruby/object:Gem::Requirement
194
195
  none: false
195
196
  requirements: