monitor.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:awslambdamonitor 作者: gene1wood 项目源码 文件源码
def ftp(config, host):
    """
    Check a hosts FTP service

    :param config: dictionary containing settings
        config['vars']['ftp_timeout']: The timeout in seconds to wait for the
        ftp connection to complete by
    :param host: The host to connect to over FTP
    :return: 3-tuple of (success, name, message)
        success: Boolean value indicating if there is a problem or not
        name: DNS name
        message: String describing the status
    """
    name = host
    try:
        ftp_conn = FTP(host=host,
                       timeout=config['vars']['ftp_timeout'])
    except Exception as e:
        return False, name, "Exception %s %s" % (e.__class__, e)
    welcome = ftp_conn.getwelcome()
    ftp_conn.quit()
    return True, name, "FTP ok %s" % welcome
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号