forked from ytti/oxidized
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hios.rb
38 lines (31 loc) · 748 Bytes
/
hios.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Hios < Oxidized::Model
## Docker location: /var/lib/gems/2.7.0/gems/oxidized-0.28.0/lib/oxidized/model/hios.rb
prompt /^\[[\w\s\W]+\][>|#]+?$/
comment '## '
# Handle pager
expect /^--More--.*$/ do |data, re|
send 'n'
data.sub re, ''
end
cmd :all do |cfg|
cfg.cut_both
end
cmd 'show system info' do |cfg|
cfg.gsub! /^System uptime.*\n/, ""
cfg.gsub! /^Operating hours.*\n/, ""
cfg.gsub! /^System date.*\n/, ""
cfg.gsub! /^Current temperature.*\n/, ""
comment cfg
end
cmd 'show running-config script' do |cfg|
cfg
end
cfg :telnet do
username /^User:/
password /^Password:/
end
cfg :telnet, :ssh do
post_login 'enable'
pre_logout "logout\nY\r\n"
end
end