Sha256: fa61bc05a54a2fe57acfd1739bad1024135e91a74f2165d5220bc19efcf29cf8

Contents?: true

Size: 743 Bytes

Versions: 3

Compression:

Stored size: 743 Bytes

Contents

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

  comment '## '

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

  cmd :all do |cfg|
    cfg.each_line.to_a[1..-2].join
  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

3 entries across 3 versions & 1 rubygems

Version Path
oxidized-0.24.0 lib/oxidized/model/hirschmann.rb
oxidized-0.23.0 lib/oxidized/model/hirschmann.rb
oxidized-0.22.0 lib/oxidized/model/hirschmann.rb