class IOS < Oxidized::Model prompt /^([\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 # get rid of errors for commands that don't work on some devices cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, '' cfg.cut_both end cmd :secret do |cfg| cfg.gsub! /^(snmp-server community).*/, '\\1 ' cfg.gsub! /^(snmp-server host \S+( vrf \S+)?( version (1|2c|3))?)\s+\S+((\s+\S*)*)\s*/, '\\1