From c252a589b6b0274a17bfe40db3fd57ebeea3beb8 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 1 May 2013 13:45:02 +0300 Subject: =?UTF-8?q?Add=20Model#expect,=20support=20block=20at=C2=A0post/pr?= =?UTF-8?q?e=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now we can deal with pager and additional PW prompts, such as 'enable' Examples in IOS model how to use. The Telnet implementation is particularly fugly, I just need one line in 'waitfor' to handle pager while waiting for prompt, but couldn't figure out clean way to do it, so needed to rewrit whole Telnet#waitfor just to add that line. --- lib/oxidized/config/bootstrap.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/oxidized/config/bootstrap.rb') diff --git a/lib/oxidized/config/bootstrap.rb b/lib/oxidized/config/bootstrap.rb index 6d865b5..bae2b70 100644 --- a/lib/oxidized/config/bootstrap.rb +++ b/lib/oxidized/config/bootstrap.rb @@ -4,13 +4,16 @@ module Oxidized CFG.username = 'username' CFG.password = 'password' CFG.model = 'junos' - CFG.interval = 60 + CFG.interval = 3600 CFG.log = File.join Config::Root, 'log' CFG.debug = false CFG.threads = 30 CFG.timeout = 5 - CFG.prompt = /^([\w\.\-@]{3,30}[#>]\s?)$/ + CFG.prompt = /^([\w.@-]+[#>]\s?)$/ CFG.rest = 8888 + CFG.vars = { + :enable => 'enablePW', + } CFG.input = { :default => 'ssh, telnet', } -- cgit v1.2.1