riemann-babbler 1.0.7.8 → 1.0.7.9
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/plugins/statusfile.rb +21 -0
- data/lib/riemann/version.rb +1 -1
- metadata +3 -2
@@ -0,0 +1,21 @@
|
|
1
|
+
class Riemann::Babbler::Chkfile < Riemann::Babbler
|
2
|
+
|
3
|
+
def init
|
4
|
+
plugin.set_default(:service, 'check state file')
|
5
|
+
plugin.states.set_default(:critical, 1)
|
6
|
+
plugin.set_default(:file, '/var/tmp/error.txt')
|
7
|
+
plugin.set_default(:interval, 60)
|
8
|
+
plugin.set_default(:lines, 5)
|
9
|
+
end
|
10
|
+
|
11
|
+
def collect
|
12
|
+
content = File.read(plugin.file).split("\n").delete_if {|x| x.strip.empty? }
|
13
|
+
{
|
14
|
+
:service => plugin.service + " file #{plugin.file}",
|
15
|
+
:description => content.last(plugin.lines).join("\n"),
|
16
|
+
:metric => content.count
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
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: 1.0.7.
|
4
|
+
version: 1.0.7.9
|
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-
|
12
|
+
date: 2013-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riemann-client
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- lib/riemann/babbler/plugins/netstat.rb
|
173
173
|
- lib/riemann/babbler/plugins/nginx.rb
|
174
174
|
- lib/riemann/babbler/plugins/runit.rb
|
175
|
+
- lib/riemann/babbler/plugins/statusfile.rb
|
175
176
|
- lib/riemann/babbler/plugins/twcli.rb
|
176
177
|
- lib/riemann/babbler/support/deep_merge.rb
|
177
178
|
- lib/riemann/babbler/support/monkey_patches.rb
|