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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ymlex/argusyml.rb +21 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3e6f1fdb715794556a6c187c6d28e87c5b34f01
4
- data.tar.gz: cd282159bad7c048c7fa23691b402aa7804ee41d
3
+ metadata.gz: c1b1f168058e598e2f2b143d96a89baeab4b8381
4
+ data.tar.gz: 87ee68eea5a05c7057d8d4559ed5a1648e60164a
5
5
  SHA512:
6
- metadata.gz: 26d05fd7723962c7065b62bfbe416e822acd3fd8a7a57b498baf77806fb58246d3aa073c1d2db3a65b5fd9985205e2efe1a24594a2e92b3dcc25cb11db4977d2
7
- data.tar.gz: 2ed9bf4f123091632b887a732a733ef479e7cce3b313182cd61456b2776b47d3d065e959cae8f3d464b447dde381d4f1e67bca65370ab74f592fa26e7dd26bff
6
+ metadata.gz: e643aac899a30470c97ac4fd176d81e2f76d1288c0618a2f734013e482ee746451164b75ab3d28278c4d22f0947fb57fac1da5d1df6edc603695307526171e67
7
+ data.tar.gz: 876002f4bc1e44bfcf1d5d27d59016459e9ccd35dd1dc2355a10e61ec36e6909a5d00f434047efdaf840d276313a525d8e268793c4a1808af73011227687d9d2
@@ -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" => "#z_ecomop_maop_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
- oncall = level["oncall"]
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;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"))
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",
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.6
4
+ version: 1.1.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wen Li