'Initialize the scanner.'

def __init__(self, config):

    from pysnmp.entity.rfc3413.oneliner import cmdgen
    from pysnmp.entity import config as cfg
    self.snmp = cmdgen.CommandGenerator()
    self.host = cmdgen.UdpTransportTarget((config[CONF_HOST], 161))
    if ((CONF_AUTHKEY not in config) or (CONF_PRIVKEY not in config)):
        self.auth = cmdgen.CommunityData(config[CONF_COMMUNITY])
    else:
        self.auth = cmdgen.UsmUserData(config[CONF_COMMUNITY], config[CONF_AUTHKEY], config[CONF_PRIVKEY], authProtocol=cfg.usmHMACSHAAuthProtocol, privProtocol=cfg.usmAesCfb128Protocol)
    self.baseoid = cmdgen.MibVariable(config[CONF_BASEOID])
    self.last_results = []
    data = self.get_snmp_data()
    self.success_init = (data is not None)
