riemann-babbler 2.0.6 → 2.0.6.1

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: 8076b21e91b26cb3d8323585c13ae84de045a4ec
4
- data.tar.gz: 959a7ecac63b0dadd24f9a2d8abdf763a71b6472
3
+ metadata.gz: b9e2fdfc477abdb29bc67c81807afbc977b2367f
4
+ data.tar.gz: efa002796350ce93cff240733bd10f630aa8104e
5
5
  SHA512:
6
- metadata.gz: 071a83b298c637d3bd27f28853a7602e4a38a9d0e8a80861c476fdc7a387b5e36d1f36df952a6ef0e27bd9803817a7c84e39c2285c97fa9509532cf03c858a33
7
- data.tar.gz: 612abe7638ace391e9a70cb978e3cee95499e0632a398d258bb594bd7b7c58ab55d002fb42ba033c274beefb0ae26db69d764ec1cdb66144fc27d2f8c50997a1
6
+ metadata.gz: 7a9ab4d2efb5d8a254ad8d751d1a95196c8a948cbafaa8be66556a8d1926039b02234bf0ca690564c965af6c7ec8449049fa62db6f05f1b55fe431231781544b
7
+ data.tar.gz: 448b4a54abcd752f673f2af01424cf2e2a3d65485a722994c796c1264a36e6aca3d9dbc9e092c22945bfa1d4e60b7cddbeb8a53aca53cd55d2f7d1546bf9467d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- riemann-babbler (2.0.6)
4
+ riemann-babbler (2.0.6.1)
5
5
  configatron
6
6
  docile
7
7
  file-tail
@@ -10,12 +10,18 @@ class Riemann::Babbler::Plugin::Iptables < Riemann::Babbler::Plugin
10
10
  File.exists? plugin.rules_file
11
11
  end
12
12
 
13
+ def delete_counters(str)
14
+ str.gsub(/\[\d+\:\d+\]/, '').strip
15
+ end
16
+
13
17
  def collect
14
18
 
15
- current_rules = shell('iptables-save | grep -v "^#"').split("\n").map {|x| x.strip}.compact.join("\n")
19
+ current_rules = shell('iptables-save | grep -v "^#"').split("\n").map do |x|
20
+ delete_counters(x)
21
+ end.compact.join("\n")
16
22
 
17
23
  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
24
+ x[0] == "#" ? nil : delete_counters(x) # delete counters and comments
19
25
  end.compact.join("\n")
20
26
 
21
27
  status = current_rules == saved_rules ? 'ok' : 'critical'
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  module Babbler
3
- VERSION = '2.0.6'
3
+ VERSION = '2.0.6.1'
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: 2.0.6
4
+ version: 2.0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasiliev Dmitry