Sha256: 87a639a01cf1c1e14a6f254723112458221cad2ee6cf0b6a1dfa0430c8c32aef

Contents?: true

Size: 721 Bytes

Versions: 9

Compression:

Stored size: 721 Bytes

Contents

class Hirschmann < Oxidized::Model
  prompt /^[(\w\s)]+\s[>|#]+?$/

  comment '## '

  # Handle pager
  expect /^--More--.*$/ do |data, re|
    send 'a'
    data.sub re, ''
  end

  cmd :all do |cfg|
    cfg.cut_both
  end

  cmd 'show sysinfo' do |cfg|
    cfg.gsub! /^System Up Time.*\n/, ""
    cfg.gsub! /^System Date and Time.*\n/, ""
    cfg.gsub! /^CPU Utilization.*\n/, ""
    cfg.gsub! /^Memory.*\n/, ""
    cfg.gsub! /^Average CPU Utilization.*\n/, ""
    comment cfg
  end

  cmd 'show running-config' do |cfg|
    cfg.gsub! /^users.*\n/, ""
    cfg
  end

  cfg :telnet do
    username /^User:/
    password /^Password:/
  end

  cfg :telnet, :ssh do
    post_login 'enable'
    pre_logout 'logout'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
oxidized-0.29.0 lib/oxidized/model/hirschmann.rb
oxidized-0.28.0 lib/oxidized/model/hirschmann.rb
oxidized-0.27.0 lib/oxidized/model/hirschmann.rb
oxidized-0.26.3 lib/oxidized/model/hirschmann.rb
oxidized-0.26.2 lib/oxidized/model/hirschmann.rb
oxidized-0.26.1 lib/oxidized/model/hirschmann.rb
oxidized-0.26.0 lib/oxidized/model/hirschmann.rb
oxidized-0.25.1 lib/oxidized/model/hirschmann.rb
oxidized-0.25.0 lib/oxidized/model/hirschmann.rb