aio_elin 1.0.5 → 1.0.6
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.
- checksums.yaml +4 -4
- data/lib/aio/core/device/methods.rb +94 -119
- data/lib/aio/core/text/warning.rb +1 -1
- data/lib/modules/cmd/h3c/display_cpu.rb +9 -3
- data/lib/modules/cmd/h3c/display_power.rb +72 -72
- data/lib/modules/cmd/h3c/display_vrrp_verbose.rb +75 -75
- data/lib/modules/output/style/excel_table_wps.rb +368 -392
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d58fe2e4aa1926532b060162295287d8bcb4e21558abc6c076eab95880c2193b
|
4
|
+
data.tar.gz: 621981fd2c0f9ff81bca907737fcde468cd569299f26e31d1e5d2ac696f2b1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 157a2bf1cf0e15ea4b4bb1fab624f5e0a29b46a59e4c8a541e7702e757da5a10ee6c4e6fe1993af336ff61e9bde4aceaf5d93f13f905e1dcdb2ecacc0ee5d314
|
7
|
+
data.tar.gz: 38a0fe68b1f51befcb0d8c13d959678585159ad20f608518aa253b9e81bb40396c22401aca2bce59de9abca10b9e1ed26ac73d52c238186d1c69f218dddcb34f
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'byebug'
|
1
|
+
#require 'byebug'
|
2
2
|
#
|
3
3
|
# 这个模块用于统一命令方法,方便一起管理
|
4
4
|
#
|
@@ -18,187 +18,162 @@ module Aio::Device
|
|
18
18
|
|
19
19
|
# CPU 利用率百分比
|
20
20
|
def cpu_percent
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
return ""
|
28
|
-
end
|
21
|
+
cmd = CmdSwitch.cpu(klass)
|
22
|
+
return klass.cmds_useful[cmd][:cpu][:minutes_5] if kind_of?(Cisco, H3C)
|
23
|
+
return klass.cmds_useful[cmd][:cpu][:used_percent] if klass.kind_of? Maipu
|
24
|
+
rescue Exception
|
25
|
+
puts_error
|
26
|
+
return ""
|
29
27
|
end
|
30
28
|
|
31
29
|
# Memory 利用率百分比
|
32
30
|
def memory_percent
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
return ""
|
41
|
-
end
|
31
|
+
cmd = CmdSwitch.memory(klass)
|
32
|
+
return klass.cmds_useful[cmd][:memory][:used_rate] if klass.kind_of? H3C
|
33
|
+
return klass.cmds_useful[cmd][:memory][:proc_ratio] if klass.kind_of? Cisco
|
34
|
+
return klass.cmds_useful[cmd][:memory][:used_percent] if klass.kind_of? Maipu
|
35
|
+
rescue Exception
|
36
|
+
puts_error
|
37
|
+
return ""
|
42
38
|
end
|
43
39
|
|
44
40
|
# IOS 版本
|
45
41
|
def ios_version
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
return ""
|
52
|
-
end
|
42
|
+
cmd = CmdSwitch.version(klass)
|
43
|
+
return klass.cmds_useful[cmd][:software][:version] if kind_of?(Cisco, H3C, Maipu)
|
44
|
+
rescue Exception
|
45
|
+
puts_error
|
46
|
+
return ""
|
53
47
|
end
|
54
48
|
|
55
49
|
# IOS 特性集
|
56
50
|
def soft_image
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
return ""
|
65
|
-
ensure
|
66
|
-
end
|
51
|
+
cmd = CmdSwitch.version(klass)
|
52
|
+
return klass.cmds_useful[cmd][:software][:soft_image] if kind_of?(Cisco, Maipu)
|
53
|
+
|
54
|
+
# H3C 不是在version中查看
|
55
|
+
rescue Exception
|
56
|
+
puts_error
|
57
|
+
return ""
|
67
58
|
end
|
68
59
|
|
69
60
|
# 运行时间
|
70
61
|
def uptime
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
return ""
|
77
|
-
end
|
62
|
+
cmd = CmdSwitch.version(klass)
|
63
|
+
return klass.cmds_useful[cmd][:software][:uptime] if kind_of?(Cisco, H3C, Maipu)
|
64
|
+
rescue Exception
|
65
|
+
puts_error
|
66
|
+
return ""
|
78
67
|
end
|
79
68
|
|
80
69
|
# 判断温度是否有警告
|
81
70
|
def warning_env?
|
82
|
-
|
83
|
-
|
84
|
-
return (klass.include_warning?(:mainboard_temperature) and klass.include_warning?(:cpu_temperature))
|
85
|
-
end
|
86
|
-
return klass.include_warning?(:cpu_status) if klass.kind_of? Cisco
|
87
|
-
rescue Exception
|
88
|
-
puts_error
|
71
|
+
if klass.kind_of? Maipu
|
72
|
+
return (klass.include_warning?(:mainboard_temperature) and klass.include_warning?(:cpu_temperature))
|
89
73
|
end
|
74
|
+
return klass.include_warning?(:cpu_status) if klass.kind_of? Cisco
|
75
|
+
rescue Exception
|
76
|
+
puts_error
|
90
77
|
end
|
91
78
|
|
92
79
|
|
93
80
|
# 判断电源是否有警告
|
94
81
|
def warning_power?
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
puts_error
|
99
|
-
end
|
82
|
+
return klass.include_warning?(:power_status) if kind_of?(Cisco, H3C, Maipu)
|
83
|
+
rescue Exception
|
84
|
+
puts_error
|
100
85
|
end
|
101
86
|
|
102
87
|
# 判断风扇是否有警告
|
103
88
|
def warning_fan?
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
puts_error
|
108
|
-
end
|
89
|
+
return klass.include_warning?(:fan_status) if kind_of?(Cisco, H3C, Maipu)
|
90
|
+
rescue Exception
|
91
|
+
puts_error
|
109
92
|
end
|
110
93
|
|
111
94
|
# 只判断最关键的三个信息
|
112
95
|
def warning_interface?
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
return tmp
|
119
|
-
end
|
120
|
-
rescue Exception
|
121
|
-
puts_error
|
96
|
+
if kind_of?(Cisco, Maipu, H3C)
|
97
|
+
tmp = klass.include_warning?(:input_errors)
|
98
|
+
tmp = tmp or klass.include_warning(:crc)
|
99
|
+
tmp = tmp or klass.include_warning(:output_errors)
|
100
|
+
return tmp
|
122
101
|
end
|
102
|
+
rescue Exception
|
103
|
+
puts_error
|
123
104
|
end
|
124
105
|
|
125
106
|
# 板卡序列号信息
|
126
107
|
# 返回数组: [{:name, :pid, :sn, :description}]
|
127
108
|
def inventory
|
128
109
|
cmd = CmdSwitch.inventory(klass)
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
res << klass.cmds_useful[cmd][:inventory][sn.to_sym]
|
135
|
-
end
|
136
|
-
return res
|
137
|
-
else
|
138
|
-
return [{:name => "", :pid => "", :sn => "", :description => ""}]
|
110
|
+
if kind_of?(Cisco, H3C)
|
111
|
+
keys = klass.cmds_useful[cmd][:inventory].keys
|
112
|
+
res = []
|
113
|
+
keys.each do |sn|
|
114
|
+
res << klass.cmds_useful[cmd][:inventory][sn.to_sym]
|
139
115
|
end
|
140
|
-
|
141
|
-
|
142
|
-
puts_error
|
116
|
+
return res
|
117
|
+
else
|
143
118
|
return [{:name => "", :pid => "", :sn => "", :description => ""}]
|
144
119
|
end
|
120
|
+
|
121
|
+
rescue Exception
|
122
|
+
puts_error
|
123
|
+
return [{:name => "", :pid => "", :sn => "", :description => ""}]
|
145
124
|
end
|
146
125
|
|
147
126
|
def clock
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
res << klass.cmds_useful[cmd][:clock][key.to_sym]
|
154
|
-
end
|
155
|
-
return res
|
156
|
-
rescue Exception
|
157
|
-
puts_error
|
158
|
-
return ["", "", "", "", "", ""]
|
127
|
+
cmd = CmdSwitch.clock(klass)
|
128
|
+
pool = ["time", "zone", "week", "year", "month", "day"]
|
129
|
+
res = []
|
130
|
+
pool.each do |key|
|
131
|
+
res << klass.cmds_useful[cmd][:clock][key.to_sym]
|
159
132
|
end
|
133
|
+
return res
|
134
|
+
rescue Exception
|
135
|
+
puts_error
|
136
|
+
return ["", "", "", "", "", ""]
|
160
137
|
end
|
161
138
|
|
162
139
|
def get_manager_ip
|
163
140
|
return klass.manager_ip unless klass.manager_ip.nil?
|
164
141
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
cmd[1] = CmdSwitch.interface_brief(klass)
|
142
|
+
cmd = []
|
143
|
+
cmd[0] = CmdSwitch.interface(klass)
|
144
|
+
cmd[1] = CmdSwitch.interface_brief(klass)
|
169
145
|
|
170
|
-
|
171
|
-
|
146
|
+
total = []
|
147
|
+
manager = ""
|
172
148
|
|
173
|
-
|
149
|
+
return unless kind_of?(Cisco, H3C, Maipu)
|
174
150
|
|
175
|
-
|
176
|
-
|
177
|
-
|
151
|
+
# 如果是 show interfaces
|
152
|
+
if klass.has_cmd?(cmd[0])
|
153
|
+
total = klass.cmds_useful[cmd[0]][:interface]
|
178
154
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
end
|
155
|
+
total.each_value do |info|
|
156
|
+
if (info[:iface_id] == (klass.interface[:loopback] + "0")) and info[:state] =~ /(?i)up/
|
157
|
+
manager = info[:addr]
|
183
158
|
end
|
159
|
+
end
|
184
160
|
|
185
|
-
|
186
|
-
|
187
|
-
|
161
|
+
# 如果是 show ip interface brief
|
162
|
+
elsif klass.has_cmd?(cmd[1])
|
163
|
+
total = klass.cmds_useful[cmd[1]][:interface_brief]
|
188
164
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
end
|
165
|
+
total.each_value do |info|
|
166
|
+
# 如果有环回口,那么就直接输出
|
167
|
+
if (info[:interface_id].downcase == klass.interface[:loopback].downcase + "0") and (info[:status] =~ /(?i)up/)
|
168
|
+
manager = info[:ip]
|
194
169
|
end
|
195
170
|
end
|
196
|
-
return manager
|
197
|
-
|
198
|
-
rescue Exception
|
199
|
-
puts_error
|
200
|
-
return ""
|
201
171
|
end
|
172
|
+
return manager
|
173
|
+
|
174
|
+
rescue Exception
|
175
|
+
puts_error
|
176
|
+
return ""
|
202
177
|
end
|
203
178
|
|
204
179
|
private
|
@@ -25,19 +25,25 @@ class Aio::Module::Cmd::H3C::DisplayCpu < Aio::Module::Cmd::H3C
|
|
25
25
|
cont = self.context.dup
|
26
26
|
useful[:cpu] = {}
|
27
27
|
loop do
|
28
|
-
cont.readline_range(/Slot \d
|
28
|
+
cont.readline_range(/(Slot|Unit) \d?\s?(CPU \d+\s+)?CPU usage/, reg_blank) do |cont_layer|
|
29
29
|
parse_cpu(cont_layer)
|
30
30
|
end
|
31
31
|
end
|
32
|
+
useful[:cpu]
|
32
33
|
end
|
33
34
|
|
34
35
|
def parse_cpu(context)
|
35
36
|
cpu = {}
|
36
37
|
useful[:cpu] = cpu
|
37
|
-
context.readline_match_block(/Slot (?<slot_id>\d
|
38
|
+
context.readline_match_block(/(Slot|Unit) (?<slot_id>\d?)\s?(CPU \d+\s+)?CPU/) do |block|
|
38
39
|
# 目前只保留 slot 0 的CPU使用率
|
39
40
|
#return if block[:slot_id].to_s != '0'
|
40
|
-
|
41
|
+
# 有可能没有 slot 项
|
42
|
+
if block[:slot_id].empty?
|
43
|
+
block.update(cpu, :slot_id, '0')
|
44
|
+
else
|
45
|
+
block.update(cpu, :slot_id)
|
46
|
+
end
|
41
47
|
end
|
42
48
|
context.readline_match_block(/(?<seconds_5>\d+)% in last 5 seconds/) do |block|
|
43
49
|
block.warning_serious(cpu, :seconds_5, self)
|
@@ -3,87 +3,87 @@
|
|
3
3
|
require "aio/core"
|
4
4
|
|
5
5
|
class Aio::Module::Cmd::H3C::DisplayPower < Aio::Module::Cmd::H3C
|
6
|
-
|
6
|
+
include Aio::Module
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
8
|
+
def initialize
|
9
|
+
super({
|
10
|
+
:cmd_full => "display power",
|
11
|
+
:cmd_short => "dis pow",
|
12
|
+
:author => "Elin",
|
13
|
+
:description => "This is H3C Command# display power",
|
14
|
+
:ranking => Ranking_1,
|
15
|
+
:platform => "all",
|
16
|
+
:benchmark => {
|
17
|
+
:power_status => ["=~", /Normal/, /Absent/],
|
18
|
+
},
|
19
|
+
})
|
20
|
+
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
def parse
|
23
|
+
cont = self.context.dup
|
24
|
+
useful[:power] = {}
|
25
|
+
case device_template
|
26
|
+
when Template_1
|
27
|
+
cont.readline_range_loop(/Slot/, /Slot/) do |cont_layer|
|
28
|
+
parse_slot(cont_layer)
|
29
|
+
end
|
30
|
+
when Template_2
|
31
|
+
cont.readline_range_loop(/Unit/, /Unit/) do |cont_layer|
|
32
|
+
parse_unit(cont_layer)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
36
|
|
37
37
|
=begin
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
def parse_def(context)
|
39
|
+
case context[0]
|
40
|
+
when /Slot/
|
41
|
+
parse_slot(context)
|
42
|
+
when /Unit/
|
43
|
+
parse_unit(context)
|
44
|
+
end
|
45
|
+
end
|
46
46
|
=end
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
def parse_slot(context)
|
49
|
+
power = {}
|
50
|
+
context.readline_match_block(/Slot (?<slot_id>\d+)/) do |block|
|
51
|
+
useful[:power] = {}
|
52
|
+
useful[:power]["slot_#{block[:slot_id]}"] = power
|
53
|
+
block.update(power, :slot_id)
|
54
|
+
end
|
55
|
+
context.readline_range_loop(/Power/, reg_blank) do |cont_layer|
|
56
|
+
parse_power(cont_layer, power)
|
57
|
+
end
|
58
|
+
end
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
60
|
+
def parse_unit(context)
|
61
|
+
power = {}
|
62
|
+
context.readline_match_block(/Unit (?<slot_id>\d+)/) do |block|
|
63
|
+
useful[:power] = {}
|
64
|
+
useful[:power]["slot_#{block[:slot_id]}"] = power
|
65
|
+
block.update(power, :slot_id)
|
66
|
+
end
|
67
|
+
context.readline_range_loop(/power/, /power/, {:before=>true}) do |cont_layer|
|
68
|
+
parse_power(cont_layer, power)
|
69
|
+
end
|
70
|
+
end
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
72
|
+
def parse_power(context, power)
|
73
|
+
power_id_info = {}
|
74
|
+
context.readline_match_block(/[Pp]ower (?<power_id>\d+)/) do |block|
|
75
|
+
power_id = block[:power_id]
|
76
|
+
power["power_#{power_id}"] = power_id_info
|
77
|
+
block.update(power_id_info, :power_id)
|
78
|
+
end
|
79
|
+
context.readline_match_block(/State : (?<power_status>.*)/) do |block|
|
80
|
+
block.warning_serious(power_id_info, :power_status, self)
|
81
|
+
end
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
83
|
+
context.readline_match_block(/Type : (?<type>.*)/) do |block|
|
84
|
+
block.update(power_id_info, :type)
|
85
|
+
end
|
86
|
+
end
|
87
87
|
end
|
88
88
|
|
89
89
|
|
@@ -3,84 +3,84 @@
|
|
3
3
|
require "aio/core"
|
4
4
|
|
5
5
|
class Aio::Module::Cmd::H3C::DisplayVrrpVerbose < Aio::Module::Cmd::H3C
|
6
|
-
|
6
|
+
include Aio::Module
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
8
|
+
def initialize
|
9
|
+
super({
|
10
|
+
:cmd_full => "display vrrp verbose",
|
11
|
+
:cmd_short => "dis vrrp ver",
|
12
|
+
:author => "Elin",
|
13
|
+
:description => "This is H3C Command# display vrrp verbose",
|
14
|
+
:ranking => Ranking_1,
|
15
|
+
:platform => "all",
|
16
|
+
:benchmark => {},
|
17
|
+
})
|
18
|
+
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
20
|
+
def parse
|
21
|
+
cont = self.context.dup
|
22
|
+
vrrp = {}
|
23
|
+
useful[:vrrp] = vrrp
|
24
|
+
cont.readline_match_block(/Run Mode : (?<run_mode>.*)/) do |block|
|
25
|
+
block.update(vrrp, :run_mode)
|
26
|
+
end
|
27
|
+
cont.readline_match_block(/Run Method : (?<run_method>.*)/) do |block|
|
28
|
+
block.update(vrrp, :run_method)
|
29
|
+
end
|
30
|
+
cont.readline_match_block(/Total number of virtual routers : (?<total_number_vrrp>\d+)/) do |block|
|
31
|
+
block.update(vrrp, :total_number_vrrp)
|
32
|
+
end
|
33
|
+
cont.readline_range(/Interface/, /Interface/) do |cont_layer|
|
34
|
+
parse_vrrp(cont_layer)
|
35
|
+
end
|
36
|
+
end
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
def parse_vrrp(cont)
|
39
|
+
vrrp = {}
|
40
|
+
useful[:vrrp][:vrid] = {}
|
41
|
+
iface_id = nil
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
43
|
+
case device_template
|
44
|
+
when Template_2
|
45
|
+
cont.readline_match_block(/Interface : (?<iface_id>.[^\s]+)/) do |block|
|
46
|
+
iface_id = block[:iface_id]
|
47
|
+
end
|
48
|
+
else
|
49
|
+
cont.readline_match_block(/Interface (?<iface_id>.*)/) do |block|
|
50
|
+
iface_id = block[:iface_id]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
cont.readline_match_block(/VRID : (?<vrid>\d+)/) do |block|
|
55
|
+
vrid = block[:vrid]
|
56
|
+
useful[:vrrp][:vrid][vrid] = vrrp
|
57
|
+
block.update(vrrp, :interface, iface_id)
|
58
|
+
block.update(vrrp, :vrid)
|
59
|
+
end
|
60
|
+
cont.readline_match_block(/Admin Status : (?<status>.*) State : (?<state>.*)/) do |block|
|
61
|
+
block.update(vrrp, :status)
|
62
|
+
block.update(vrrp, :state)
|
63
|
+
end
|
64
|
+
cont.readline_match_block(/Config Pri : (?<config_pri>.*) Running Pri : (?<running_pri>.*)/) do |block|
|
65
|
+
block.update(vrrp, :config_pri)
|
66
|
+
block.update(vrrp, :running_pri)
|
67
|
+
end
|
68
|
+
cont.readline_match_block(/Preempt Mode : (?<preempt_mode>.*) Delay Time : (?<delay_time>\d+)/) do |block|
|
69
|
+
block.update(vrrp, :preempt_mode)
|
70
|
+
block.update(vrrp, :delay_time)
|
71
|
+
end
|
72
|
+
cont.readline_match_block(/Auth Type : (?<auth_type>.*)/) do |block|
|
73
|
+
block.update(vrrp, :auth_type)
|
74
|
+
end
|
75
|
+
cont.readline_match_block(/Virtual IP : (?<virtual_ip>.*)/) do |block|
|
76
|
+
block.update(vrrp, :virtual_ip)
|
77
|
+
end
|
78
|
+
cont.readline_match_block(/Virtual MAC : (?<virtual_mac>.*)/) do |block|
|
79
|
+
block.update(vrrp, :virtual_mac)
|
80
|
+
end
|
81
|
+
cont.readline_match_block(/Master IP : (?<master_ip>.*)/) do |block|
|
82
|
+
block.update(vrrp, :master_ip)
|
83
|
+
end
|
84
|
+
end
|
85
85
|
end
|
86
86
|
|