class Oxidized::FTP
Constants
- RESCUE_FAIL
Public Instance Methods
Source
# File lib/oxidized/input/ftp.rb, line 32 def cmd(file) logger.debug "FTP: #{file} @ #{@node.name}" @ftp.getbinaryfile file, nil end
Source
# File lib/oxidized/input/ftp.rb, line 18 def connect(node) # rubocop:disable Naming/PredicateMethod @node = node @node.model.cfg['ftp'].each { |cb| instance_exec(&cb) } @log = File.open(Oxidized::Config::LOG + "/#{@node.ip}-ftp", 'w') if Oxidized.config.input.debug? @ftp = Net::FTP.new(@node.ip) @ftp.passive = Oxidized.config.input.ftp.passive @ftp.login @node.auth[:username], @node.auth[:password] connected? end
Source
# File lib/oxidized/input/ftp.rb, line 28 def connected? @ftp && (not @ftp.closed?) end
Source
# File lib/oxidized/input/ftp.rb, line 38 def send(my_proc) my_proc.call end
meh not sure if this is the best way, but perhaps better than not implementing send
Private Instance Methods
Source
# File lib/oxidized/input/ftp.rb, line 48 def disconnect @ftp.close # rescue Errno::ECONNRESET, IOError ensure @log.close if Oxidized.config.input.debug? end