summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMajesticFalcon <Schylarutley@hotmail.com>2016-08-30 18:02:00 -0500
committerGitHub <noreply@github.com>2016-08-30 18:02:00 -0500
commitcc1184abc98fd270ee8fee4925f38de08c908bb8 (patch)
tree7981e6ee03a7aed526cdbca67463324e0eac345f /lib
parent35f20515be92d57245abd24b9b2969d5d70922ba (diff)
Update Filename and tftp load
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/input/tftp.rb (renamed from lib/oxidized/input/tftp)7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/oxidized/input/tftp b/lib/oxidized/input/tftp.rb
index cac8f2d..2a6a088 100644
--- a/lib/oxidized/input/tftp
+++ b/lib/oxidized/input/tftp.rb
@@ -1,5 +1,4 @@
module Oxidized
- require 'net/tftp'
require 'timeout'
require 'stringio'
require_relative 'cli'
@@ -19,6 +18,11 @@ module Oxidized
# TFTP utilizes UDP, there is not a connection. We simply specify an IP and send/receive data.
def connect node
+ begin
+ require 'net/tftp'
+ rescue LoadError
+ raise OxidizedError, 'net/tftp not found: sudo gem install net-tftp'
+ end
@node = node
@node.model.cfg['tftp'].each { |cb| instance_exec(&cb) }
@@ -49,6 +53,7 @@ module Oxidized
def disconnect
# TFTP uses UDP, there is no connection to close
+ #rescue Errno::ECONNRESET, IOError
ensure
@log.close if Oxidized.config.input.debug?
end