ymlex 1.1.9.4 → 1.1.9.5

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ymlex/argusyml.rb +29 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42e97249cc3625e5c6886aa1a6a11005cc56bcf5
4
- data.tar.gz: 6437909558f048e8b66300802ae9dbeec93a451a
3
+ metadata.gz: 5b99d46237e473dc299403d53083d2c99baf3557
4
+ data.tar.gz: f8de64468885e1388483a923103f175b6563545b
5
5
  SHA512:
6
- metadata.gz: f12336c7639d0d36be505c8d8f6f5cc550c9a636b1512155b4e36235075ffdc0620401b7de62ce1ea83941a7c84a98e22cea7f49337c8ad19b65d016fdded983
7
- data.tar.gz: 6a889858bf0449a74b16a1e088e4b0168ce929b46a9956278cffa841f08e2fa12f25579988bcb9df31989e96966353ace79427dafef0b1eca8975c38abe093f1
6
+ metadata.gz: 367b220ec564619fead5943631fc628ae04703b7c3b4c1997d315b437fbcdf1b8dd129c3f1a3e07058db0e207327c760a630cd802098b30d7bc0796f3d00e058
7
+ data.tar.gz: 5b8df6a893a38321fad17564a4082de64847a8814321428c54b81bb2c9bc5620e2bdaae2d557943e77de0ba74283a86d2f84736daa184f284276cc0be95bec7c
@@ -36,8 +36,6 @@ class Alert
36
36
  lvl = level["op"]
37
37
  mail = "#{mail}" if lvl != nil
38
38
  sms = "#{oncall};#{sms}" if lvl =~ /err/ or lvl =~ /fatal/
39
- sms = "#{manager};#{sms}" if lvl =~ /fatal/
40
- #hi = "#{oncall}" if lvl =~ /warn/
41
39
 
42
40
  if lvl =~ /fatal/
43
41
  remind_time = "900"
@@ -64,9 +62,37 @@ class Alert
64
62
  rule_level = "1"
65
63
  end
66
64
 
67
- web = "g_ecomop_maop_all;g_ecomop_maop_manager;" if sms.include? "g_ecomop_maop_all" or sms.include? "#z_ecomop_maop_oncall"
65
+ web = "g_ecomop_maop_all;g_ecomop_maop_manager;" if sms.include? "g_ecomop_maop_all" or sms.include? "#z_ecomop_maop_oncall" or (lvl =~ /fatal/ and (manager.include? "#z_ecomop_maop_oncall" or manager.include? "g_ecomop_maop_manager"))
68
66
  sms.gsub!(/g_ecomop_maop_all/,'#z_ecomop_maop_oncall')
69
67
  mail.gsub!(/g_ecomop_maop_all/,'ma-op')
68
+
69
+ mail_list = mail.split ";"
70
+ mail_list_uniq = mail_list.uniq
71
+ if mail_list_uniq.nil? #or mail_list_uniq.empty?
72
+ mail = ""
73
+ else
74
+ mail_list_uniq.delete ""
75
+ mail = mail_list_uniq.join ";"
76
+ end
77
+
78
+ sms_list = sms.split ";"
79
+ sms_list_uniq = sms_list.uniq
80
+ if sms_list_uniq.nil? #or sms_list_uniq.empty?
81
+ sms = ""
82
+ else
83
+ sms_list_uniq.delete ""
84
+ sms = sms_list_uniq.join ";"
85
+ end
86
+
87
+ hi_list = hi.split ";"
88
+ hi_list_uniq = hi_list.uniq
89
+ if hi_list_uniq.nil? #or hi_list_uniq.empty?
90
+ hi = ""
91
+ else
92
+ hi_list_uniq.delete ""
93
+ hi = hi_list_uniq.join ";"
94
+ end
95
+
70
96
  alt = {
71
97
  "max_alert_times" => level["max_alert_times"] || "1",
72
98
  "alert_threshold_percent" => level["alert_threshold_percent"] || "0",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ymlex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9.4
4
+ version: 1.1.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wen Li