From bf299889f54b468412df4822b515cf7c4d60f90d Mon Sep 17 00:00:00 2001 From: Jari Salo Date: Wed, 6 Aug 2014 14:12:19 +0300 Subject: Added Huawei VRP model support. --- lib/oxidized/model/vrp.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/oxidized/model/vrp.rb (limited to 'lib/oxidized/model/vrp.rb') diff --git a/lib/oxidized/model/vrp.rb b/lib/oxidized/model/vrp.rb new file mode 100644 index 0000000..12a9ca3 --- /dev/null +++ b/lib/oxidized/model/vrp.rb @@ -0,0 +1,34 @@ +class VRP < Oxidized::Model + # Huawei VRP + + prompt /^(<[\w.-]+>)$/ + comment '# ' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-2].join + end + + cfg :telnet do + username /^Username:$/ + password /^Password:$/ + end + + cfg :telnet, :ssh do + post_login 'screen-length 0 temporary' + pre_logout 'quit' + end + + cmd 'display version' do |cfg| + cfg = cfg.each_line.select {|l| not l.match /uptime/ }.join + comment cfg + end + + cmd 'display device' do |cfg| + comment cfg + end + + cmd 'display current-configuration all' do |cfg| + cfg + end + +end -- cgit v1.2.1