riemann-babbler 2.0.5 → 2.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9915b5a001d3c3f81b76a15e7c50c848c94f59e6
4
- data.tar.gz: 21db07879c0c11ee089a0597f7976404c45c26fe
3
+ metadata.gz: 8076b21e91b26cb3d8323585c13ae84de045a4ec
4
+ data.tar.gz: 959a7ecac63b0dadd24f9a2d8abdf763a71b6472
5
5
  SHA512:
6
- metadata.gz: 74c7ed6b265d2a7d366b26fab1e6df92d21d4b29fc60fa5e6652451ff8ef201a09f6b8f2562624e5246073ebc6338299249b7c4147bf5bc8b6dc9f2910db4147
7
- data.tar.gz: a4c58781c080e2777668b4e84f6915bc069599761c8c3b06aa60f5511efe9b66c49db027349e1fa6f3494a6235068977e2f5e1860a6ac5eaf293dcfa993a10ee
6
+ metadata.gz: 071a83b298c637d3bd27f28853a7602e4a38a9d0e8a80861c476fdc7a387b5e36d1f36df952a6ef0e27bd9803817a7c84e39c2285c97fa9509532cf03c858a33
7
+ data.tar.gz: 612abe7638ace391e9a70cb978e3cee95499e0632a398d258bb594bd7b7c58ab55d002fb42ba033c274beefb0ae26db69d764ec1cdb66144fc27d2f8c50997a1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- riemann-babbler (2.0.5)
4
+ riemann-babbler (2.0.6)
5
5
  configatron
6
6
  docile
7
7
  file-tail
@@ -21,6 +21,7 @@ module Riemann
21
21
  'net',
22
22
  'runit',
23
23
  'tw_cli',
24
+ 'iptables',
24
25
  'errors_reporter',
25
26
  'responder'
26
27
  ].freeze
@@ -0,0 +1,30 @@
1
+ class Riemann::Babbler::Plugin::Iptables < Riemann::Babbler::Plugin
2
+
3
+ def init
4
+ plugin.set_default(:service, 'iptables')
5
+ plugin.set_default(:rules_file, '/etc/network/iptables')
6
+ plugin.set_default(:interval, 60)
7
+ end
8
+
9
+ def run_plugin
10
+ File.exists? plugin.rules_file
11
+ end
12
+
13
+ def collect
14
+
15
+ current_rules = shell('iptables-save | grep -v "^#"').split("\n").map {|x| x.strip}.compact.join("\n")
16
+
17
+ saved_rules = File.read(plugin.rules_file).split("\n").map do |x|
18
+ x[0] == "#" ? nil : x.gsub(/\[\d+\:\d+\]/, '').strip # delete counters and comments
19
+ end.compact.join("\n")
20
+
21
+ status = current_rules == saved_rules ? 'ok' : 'critical'
22
+ {
23
+ :service => "#{plugin.service} #{plugin.rules_file}",
24
+ :state => status, # status 'ok' will be minimized
25
+ :description => "#{plugin.service} rules different between file: #{plugin.rules_file} and iptables-save"
26
+ }
27
+
28
+ end
29
+
30
+ end
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  module Babbler
3
- VERSION = '2.0.5'
3
+ VERSION = '2.0.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-babbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasiliev Dmitry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-07 00:00:00.000000000 Z
11
+ date: 2013-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riemann-client
@@ -245,6 +245,7 @@ files:
245
245
  - lib/riemann/babbler/plugins/helpers/shell.rb
246
246
  - lib/riemann/babbler/plugins/helpers/unixnow.rb
247
247
  - lib/riemann/babbler/plugins/http.rb
248
+ - lib/riemann/babbler/plugins/iptables.rb
248
249
  - lib/riemann/babbler/plugins/la.rb
249
250
  - lib/riemann/babbler/plugins/mdadm.rb
250
251
  - lib/riemann/babbler/plugins/mega_cli.rb