Sha256: 6f0941dd82a0dd57ffca980b04ae1b51ed87049e4889e9adb85f4db2d2bfb39e
Contents?: true
Size: 579 Bytes
Versions: 15
Compression:
Stored size: 579 Bytes
Contents
module WatchmonkeyCli module Checkers class FtpAvailability < Checker self.checker_name = "ftp_availability" def enqueue host, opts = {} opts = { threshold: 1.months }.merge(opts) app.enqueue(self, host, opts) end def check! result, host, opts = {} Net::FTP.open(host) do |ftp| ftp.login(opts[:user], opts[:password]) end rescue Net::FTPPermError result.error! "Invalid credentials!" rescue SocketError => e result.error! "#{e.class}: #{e.message}" end end end end
Version data entries
15 entries across 15 versions & 1 rubygems