def scan():
    """Scans for threshold rules and evaluates them"""
    rules = ThresholdRule.objects.all()
    alerts = get_unresolved_threshold_alerts()

    _logger.info("evaluating %d rules", len(rules))
    for rule in rules:
        evaluate_rule(rule, alerts)
    _logger.info("done")