nagios_mklivestatus 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,4 +24,7 @@
24
24
  * adding logs to verbose mode
25
25
 
26
26
  == 0.0.11
27
- * correcting bug : limit
27
+ * correcting bug : limit
28
+
29
+ == 0.0.12
30
+ * take care of spaces in values for filters, stats and wait in the parser and the helper
@@ -27,12 +27,12 @@ module Nagios::MkLiveStatus::QueryHelper
27
27
  # Split the string into 3 parameters in order to create the correct filter.
28
28
  # Must match the regular expression : /^(Filter: )?(\S+) (\S+) ?(\S+)?$/
29
29
  def nagmk_filter_from_str(filter_str)
30
- predicates = filter_str.strip.match(/^(Filter: )?(\S+) (\S+) ?(\S+)?$/)
30
+ predicates = filter_str.strip.match(/^(Filter: )?(\S+) (\S+) ?([\S ]+)?$/)
31
31
  if predicates
32
32
  return nagmk_filter(predicates[2], predicates[3], predicates[4])
33
33
  end
34
34
 
35
- raise QueryException.new("Can't create filter because the expression doesn't match /^(Filter: )?(\S+) (\S+) ?(\S+)?$/")
35
+ raise QueryException.new("Can't create filter because the expression doesn't match /^(Filter: )?(\S+) (\S+) ?([\S ]+)?$/")
36
36
  end
37
37
 
38
38
  # Create a stats with parameters.
@@ -43,7 +43,7 @@ module Nagios::MkLiveStatus::QueryHelper
43
43
  # Split the string into 4 parameters in order to create the correct stats.
44
44
  # Must match the regular expression : /^(Stats: )?(\S+) (\S+) ?(\S+)?$/
45
45
  def nagmk_stats_from_str(stats_str)
46
- predicates = stats_str.strip.match(/^(Stats: )?(\S+) (\S+) ?(\S+)?$/)
46
+ predicates = stats_str.strip.match(/^(Stats: )?(\S+) (\S+) ?([\S ]+)?$/)
47
47
  if predicates
48
48
  if get_all_deviations.include? predicates[2]
49
49
  return nagmk_stats(predicates[3], nil, nil, predicates[2])
@@ -52,7 +52,7 @@ module Nagios::MkLiveStatus::QueryHelper
52
52
  end
53
53
  end
54
54
 
55
- raise QueryException.new("Can't create stats because the expression doesn't match /^(Stats: )?(\S+) (\S+) ?(\S+)?$/")
55
+ raise QueryException.new("Can't create stats because the expression doesn't match /^(Stats: )?(\S+) (\S+) ?([\S ]+)?$/")
56
56
  end
57
57
 
58
58
  # Create a wait condition with the parameters.
@@ -63,12 +63,12 @@ module Nagios::MkLiveStatus::QueryHelper
63
63
  # Split the string into 3 parameters in order to create the correct wait condition.
64
64
  # Must match the regular expression : /^(WaitCondition: )?(\S+) (\S+) ?(\S+)?$/
65
65
  def nagmk_wait_condition_from_str(wait_cond_str)
66
- predicates = wait_cond_str.strip.match(/^(WaitCondition: )?(\S+) (\S+) ?(\S+)?$/)
66
+ predicates = wait_cond_str.strip.match(/^(WaitCondition: )?(\S+) (\S+) ?([\S ]+)?$/)
67
67
  if predicates
68
68
  return nagmk_wait_condition(predicates[2], predicates[3], predicates[4])
69
69
  end
70
70
 
71
- raise QueryException.new("Can't create wait condition because the expression doesn't match /^(WaitCondition: )?(\S+) (\S+) ?(\S+)?$/")
71
+ raise QueryException.new("Can't create wait condition because the expression doesn't match /^(WaitCondition: )?(\S+) (\S+) ?([\S ]+)?$/")
72
72
  end
73
73
 
74
74
  # Create the and filter expression between two filters.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nagios_mklivestatus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
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: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2012-10-31 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Querying Nagios MKLiveStatus through TCP or Unix sockets
15
15
  email: team@esco-lan.org