class Planet < Oxidized::Model prompt /^\r?([\w.@()-]+[#>]\s?)$/ comment '! ' # example how to handle pager #expect /^\s--More--\s+.*$/ do |data, re| # send ' ' # data.sub re, '' #end # non-preferred way to handle additional PW prompt #expect /^[\w.]+>$/ do |data| # send "enable\n" # send vars(:enable) + "\n" # data #end cmd :all do |cfg| #cfg.gsub! /\cH+\s{8}/, '' # example how to handle pager #cfg.gsub! /\cH+/, '' # example how to handle pager cfg.each_line.to_a[1..-2].join end cmd :secret do |cfg| cfg.gsub! /^(snmp-server community).*/, '\\1 ' cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '