def METHOD_NAME(h):
    """
    checks the staleness of Host h and if it stale, react by increasing the
    staleness counter. When counter reaches some threshold, first make host
    unavailable, then remove host.
    Return email msg and log msg (each can be None).
    :param h:
    :return: email_msg, log_msg
    """
    email_msg = log_msg = None
    t_now = timezone.now()
    last_update_ipv4 = h.last_update_ipv4 or NEVER
    last_update_ipv6 = h.last_update_ipv6 or NEVER
    last_update_ip = max(last_update_ipv4, last_update_ipv6)
    ip_age = (t_now - last_update_ip).total_seconds()
    staleness = old_staleness = h.staleness
    last_notification = h.staleness_notification_timestamp or NEVER
    notification_age = (t_now - last_notification).total_seconds()
    changed = False
    if ip_age < T_ip:
        staleness = S_notstale
        if old_staleness != staleness:
            h.staleness = staleness  # ip has been updated recently
            changed = True
    elif notification_age < T_react:
        pass  # since we notified, not enough time has passed for owner to react
    else:
        staleness = old_staleness + 1
        if staleness >= S_delete:
            h.delete()
            EMAIL_MSG_DELETE = u"%s%s%s" % (EMAIL_MSG_START, LOG_MSG_DELETE, EMAIL_MSG_END_DELETED)
            email_msg, log_msg = EMAIL_MSG_DELETE, LOG_MSG_DELETE
        elif staleness >= S_unavailable:
            h.staleness = staleness
            h.available = False  # TODO remove host from dns also
            h.staleness_notification_timestamp = t_now
            changed = True
            EMAIL_MSG_UNAVAILABLE = u"%s%s%s" % (EMAIL_MSG_START, LOG_MSG_UNAVAILABLE, EMAIL_MSG_END)
            email_msg, log_msg = EMAIL_MSG_UNAVAILABLE, LOG_MSG_UNAVAILABLE
        else:
            h.staleness = staleness
            h.staleness_notification_timestamp = t_now
            changed = True
            EMAIL_MSG_STALE = u"%s%s%s" % (EMAIL_MSG_START, LOG_MSG_STALE, EMAIL_MSG_END)
            email_msg, log_msg = EMAIL_MSG_STALE, LOG_MSG_STALE
    if changed:
        h.save()
    return staleness, email_msg, log_msg