ymlex 1.1.9.6 → 1.1.9.7
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 +21 -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: c1b1f168058e598e2f2b143d96a89baeab4b8381
|
4
|
+
data.tar.gz: 87ee68eea5a05c7057d8d4559ed5a1648e60164a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e643aac899a30470c97ac4fd176d81e2f76d1288c0618a2f734013e482ee746451164b75ab3d28278c4d22f0947fb57fac1da5d1df6edc603695307526171e67
|
7
|
+
data.tar.gz: 876002f4bc1e44bfcf1d5d27d59016459e9ccd35dd1dc2355a10e61ec36e6909a5d00f434047efdaf840d276313a525d8e268793c4a1808af73011227687d9d2
|
data/lib/ymlex/argusyml.rb
CHANGED
@@ -9,7 +9,7 @@ class Alert
|
|
9
9
|
attr :contacts, :default_level
|
10
10
|
def initialize contacts, level={}
|
11
11
|
@contacts = contacts
|
12
|
-
@default_level = { "oncall" => "
|
12
|
+
@default_level = { "oncall" => "",
|
13
13
|
"manager" => "g_ecomop_maop_manager",
|
14
14
|
"phone" => "",
|
15
15
|
"rd" => "err",
|
@@ -19,7 +19,12 @@ class Alert
|
|
19
19
|
|
20
20
|
def get_alert lvl={}
|
21
21
|
level = @default_level.merge(lvl)
|
22
|
-
|
22
|
+
if @contacts["op"].include? "g_ecomop_maop_all"
|
23
|
+
oncall = "#z_ecomop_maop_oncall"
|
24
|
+
elsif @contacts["op"].include? "g_ecom_udw_op"
|
25
|
+
oncall = "#z_bdg_op_sdc"
|
26
|
+
end
|
27
|
+
#oncall = level["oncall"]
|
23
28
|
manager = level["manager"]
|
24
29
|
phone = level["phone"]
|
25
30
|
|
@@ -64,9 +69,13 @@ class Alert
|
|
64
69
|
rule_level = "1"
|
65
70
|
end
|
66
71
|
|
67
|
-
web = "g_ecomop_maop_all;
|
72
|
+
web = "#{web};g_ecomop_maop_all;" if sms.include? "g_ecomop_maop_all" or sms.include? "#z_ecomop_maop_oncall"
|
73
|
+
web = "#{web};g_ecom_udw_op;" if sms.include? "g_ecom_udw_op" or sms.include? "#z_bdg_op_sdc"
|
68
74
|
sms.gsub!(/g_ecomop_maop_all/,'#z_ecomop_maop_oncall')
|
75
|
+
sms.gsub!(/g_ecom_udw_op/,'#z_bdg_op_sdc')
|
76
|
+
|
69
77
|
mail.gsub!(/g_ecomop_maop_all/,'ma-op')
|
78
|
+
mail.gsub!(/g_ecom_udw_op/,'udw-op')
|
70
79
|
|
71
80
|
mail_list = mail.split ";"
|
72
81
|
mail_list_uniq = mail_list.uniq
|
@@ -95,6 +104,15 @@ class Alert
|
|
95
104
|
hi = hi_list_uniq.join ";"
|
96
105
|
end
|
97
106
|
|
107
|
+
web_list = web.split ";"
|
108
|
+
web_list_uniq = web_list.uniq
|
109
|
+
if web_list_uniq.nil? #or web_list_uniq.empty?
|
110
|
+
web = ""
|
111
|
+
else
|
112
|
+
web_list_uniq.delete ""
|
113
|
+
web = web_list_uniq.join ";"
|
114
|
+
end
|
115
|
+
|
98
116
|
alt = {
|
99
117
|
"max_alert_times" => level["max_alert_times"] || "1",
|
100
118
|
"alert_threshold_percent" => level["alert_threshold_percent"] || "0",
|