Exemplo n.º 1
0
Arquivo: arnold.py Projeto: hmpf/nav
def get_netbios(ip):
    """Get netbiosname of computer with ip"""

    netbios_dump = scan([ip], verbose=True)
    if not netbios_dump:
        return ""

    parsed_results = parse_get_workstations(netbios_dump)
    return parsed_results.get(ip, "")
Exemplo n.º 2
0
def main():
    """Main controller"""
    init_logger(join(localstatedir, 'log', LOGFILE))
    config = NetbiosTrackerConfig()

    start = time.time()
    _logger.info('=== Starting netbiostracker ===')

    addresses = tracker.get_addresses_to_scan(config.get_exceptions())
    scanresult = tracker.scan(addresses)
    parsed_results = tracker.parse(scanresult, config.get_encoding())
    tracker.update_database(parsed_results)

    _logger.info('Scanned %d addresses, got %d results in %.2f seconds',
                 len(addresses), len(parsed_results), time.time() - start)
    _logger.info('Netbiostracker done')
Exemplo n.º 3
0
def main():
    """Main controller"""
    init_generic_logging(logfile=join(localstatedir, 'log', LOGFILE),
                         stderr=False)
    config = NetbiosTrackerConfig()

    start = time.time()
    _logger.info('=== Starting netbiostracker ===')

    addresses = tracker.get_addresses_to_scan(config.get_exceptions())
    scanresult = tracker.scan(addresses)
    parsed_results = tracker.parse(scanresult, config.get_encoding())
    tracker.update_database(parsed_results)

    _logger.info('Scanned %d addresses, got %d results in %.2f seconds',
                 len(addresses), len(parsed_results), time.time() - start)
    _logger.info('Netbiostracker done')