diff --git a/common/check_expired_locked_rules b/common/check_expired_locked_rules index 55e139a..7bccb78 100755 --- a/common/check_expired_locked_rules +++ b/common/check_expired_locked_rules @@ -6,51 +6,109 @@ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # # Authors: -# - Cedric Serfon, , 2015 +# - Cedric Serfon, , 2020. +# - Eric Vaandering, 2020. +# - Fernando Garzon, 2020. -''' +""" Probe to check the locked expired rules or datasets with locked rules -''' +""" + +from __future__ import print_function import sys -from rucio.db.sqla.session import get_session +from datetime import datetime + +from rucio.core import monitor +from rucio.db.sqla import models +from rucio.db.sqla.session import BASE, get_session +from sqlalchemy import func # Exit statuses OK, WARNING, CRITICAL, UNKNOWN = 0, 1, 2, 3 +if BASE.metadata.schema: + schema = BASE.metadata.schema + '.' +else: + schema = '' + def main(): - ''' + """ Probe to check the locked expired rules or datasets with locked rules - ''' + """ status = OK session = get_session() try: - query = "select rawtohex(id), scope, name, rse_expression from atlas_rucio.rules where locked=1 and expires_at