summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/edgeswitch.rb
blob: 607df6c52372a4e3713a6eb0f71c4853abfd700c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class EdgeSwitch < Oxidized::Model

# Ubiquiti EdgeSwitch #

  comment '!'

  prompt /\(.*\)\s[#>]/

  cmd 'show running-config' do |cfg|
    cfg.each_line.reject { |line| line.match /System Up Time.*/ or line.match /Current SNTP Synchronized Time.*/ }.join
  end

  cfg :telnet do
    username /Username:\s/
    password /^Password:\s/
  end

  cfg :telnet, :ssh do
    post_login 'enable'
    post_login 'terminal length 0'
    pre_logout 'quit'
  end

end