From e3aa71fc17eba8586d2e0117b6b363942f577488 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Fri, 11 Jul 2014 21:06:37 +0300 Subject: add support for retrying failed attempts Looks like this in syslog: Jul 11 21:05:53 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 22" Jul 11 21:05:53 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 23" Jul 11 21:05:54 ytti oxidized[9820]: 10.10.10.10 status no_connection, retry attempt 1 Jul 11 21:05:54 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 22" Jul 11 21:05:54 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 23" Jul 11 21:05:55 ytti oxidized[9820]: 10.10.10.10 status no_connection, retry attempt 2 Jul 11 21:05:55 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 22" Jul 11 21:05:55 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 23" Jul 11 21:05:56 ytti oxidized[9820]: 10.10.10.10 status no_connection, retry attempt 3 Jul 11 21:05:56 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 22" Jul 11 21:05:56 ytti oxidized[9820]: 10.10.10.10 raised Errno::ENETUNREACH with msg "Network is unreachable - connect(2) for "10.10.10.10" port 23" Jul 11 21:05:57 ytti oxidized[9820]: 10.10.10.10 status no_connection, retries exhausted, giving up --- lib/oxidized/config.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/config.rb') diff --git a/lib/oxidized/config.rb b/lib/oxidized/config.rb index 02698a6..b4d1c64 100644 --- a/lib/oxidized/config.rb +++ b/lib/oxidized/config.rb @@ -22,7 +22,8 @@ module Oxidized CFGS.default.log = File.join Config::Root, 'log' CFGS.default.debug = false CFGS.default.threads = 30 - CFGS.default.timeout = 30 + CFGS.default.timeout = 20 + CFGS.default.retries = 3 CFGS.default.prompt = /^([\w.@-]+[#>]\s?)$/ CFGS.default.rest = '127.0.0.1:8888' # or false to disable CFGS.default.vars = {} # could be 'enable'=>'enablePW' -- cgit v1.2.1