ymlex 1.1.9.4 → 1.1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ymlex/argusyml.rb +29 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b99d46237e473dc299403d53083d2c99baf3557
|
4
|
+
data.tar.gz: f8de64468885e1388483a923103f175b6563545b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 367b220ec564619fead5943631fc628ae04703b7c3b4c1997d315b437fbcdf1b8dd129c3f1a3e07058db0e207327c760a630cd802098b30d7bc0796f3d00e058
|
7
|
+
data.tar.gz: 5b8df6a893a38321fad17564a4082de64847a8814321428c54b81bb2c9bc5620e2bdaae2d557943e77de0ba74283a86d2f84736daa184f284276cc0be95bec7c
|
data/lib/ymlex/argusyml.rb
CHANGED
@@ -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",
|