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.
- data/lib/riemann/babbler/plugin.rb +5 -1
- data/lib/riemann/babbler/plugins/netstat.rb +15 -0
- data/lib/riemann/version.rb +1 -1
- metadata +4 -3
@@ -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
|
data/lib/riemann/version.rb
CHANGED
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.
|
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-
|
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:
|
193
|
+
hash: 2125100952361117085
|
193
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
195
|
none: false
|
195
196
|
requirements:
|