Hi Steve; On Fri, 21 Jul 2017, Steve Lloyd wrote:
Hi Simon, Thanks - I get:
{'Errno': 0, 'Message': "Cannot get URL for WorkloadManagement/WMSAdministrator in setup GridPP: RuntimeError('Option /DIRAC/Setups/GridPP/WorkloadManagement is not defined',)", 'OK': False, 'rpcStub': (('WorkloadManagement/WMSAdministrator', {'skipCACheck': False, 'keepAliveLapse': 150, 'timeout': 120}), 'getSiteSummaryWeb', ({}, [], 0, -1)), 'CallStack': [' File "./getstatus.py", line 5, in <module>\n adminClient = RPCClient(\'WorkloadManagement/WMSAdministrator\', timeout=60)\n', ' File "/home/lloyd/dirac_ui/DIRAC/Core/DISET/RPCClient.py", line 29, in __init__\n self.__innerRPCClient = InnerRPCClient( *args, **kwargs )\n', ' File "/home/lloyd/dirac_ui/DIRAC/Core/DISET/private/BaseClient.py", line 58, in __init__\n result = initFunc()\n', ' File "/home/lloyd/dirac_ui/DIRAC/Core/DISET/private/BaseClient.py", line 97, in __discoverURL\n result = self.__findServiceURL()\n', ' File "/home/lloyd/dirac_ui/DIRAC/Core/DISET/private/BaseClient.py", line 203, in __findServiceURL\n return S_ERROR( "Cannot get URL for %s in setup %s: %s" % ( self._destinationSrv, self.setup, repr( e ) ) )\n']}
There is no /DIRAC/Setups (I'm assuming this means /home/lloyd/dirac_ui/DIRAC/Setups).
I get: [eesridr@pion:bigdata] > scl enable python27 bash [eesridr@pion:bigdata] > source /cvmfs/ganga.cern.ch/dirac_ui/bashrc [eesridr@pion:bigdata] > chmod +x summary.py [eesridr@pion:bigdata] > ./summary.py {'OK': True, 'rpcStub': (('WorkloadManagement/WMSAdministrator', {'skipCACheck': False, 'keepAliveLapse': 150, 'delegatedGroup': 'gridpp_user', 'delegatedDN': '/C=UK/O=eScience/OU=Brunel/L=ECE/CN=ivan reid', 'timeout': 120}), 'getSiteSummaryWeb', ({}, [], 0, -1)), 'Value': {'TotalRecords': 39, 'ParameterNames': ['Site', 'GridType', 'Country', 'Tier', 'MaskStatus', 'Received', 'Checking', 'Staging', 'Waiting', 'Matched', 'Running', 'Stalled', 'Done', 'Completed', 'Failed', 'Efficiency', 'Status'], 'Extras': {'be': {'Received': 0, 'Staging': 0, 'Checking': 0, 'Completed': 0, 'Waiting': 0, 'Failed': 0, 'Running': 0, 'Done': 1L, 'Stalled': 0, 'Matched': 0}, 'fr': {'Received': 0, 'Staging': 0, 'Checking': 0, 'Completed': 0, 'Waiting': 0, 'Failed': 0, 'Running': 0, 'Done': 0, 'Stalled': 0, 'Matched': 0}, 'ch': {'Received': 0, 'Staging': 0, 'Checking': 0, 'Completed': 0, 'Waiting': 18L, 'Failed': 0, 'Running': 0, 'Done': 9L, 'Stalled': 0, 'Matched': 0}, 'pt': {'Received': 0, 'Staging': 0, 'Checking': 0, 'Completed': 0, 'Waiting': 0, 'Failed': 0, 'Running': 7L, 'Done': 17L, 'Stalled': 0, 'Matched': 0}, 'Unknown': {'Received': 0, 'Staging': 0, 'Checking': 0, 'Completed': 0, 'Waiting': 3920L, 'Failed': 0, 'Running': 2L, 'Done': 0, 'Stalled': 0, 'Matched': 0}, 'ca': {'Received': 0, 'Staging': 0, 'Checking': 0, 'Completed': 0, 'Waiting': 0, 'Failed': 0, 'Running': 42L, 'Done': 17L, 'Stalled': 0, 'Matched': 0}, 'it': {'Received': 0, 'Staging': 0, 'Checking': 0, 'Completed': 0, 'Waiting': 0, 'Failed': 0, 'Running': 0, 'Done': 2L, 'Stalled': 0, 'Matched': 0}, 'uk': {'Received': 0, 'Staging': 0, 'Checking': 264L, 'Completed': 0, 'Waiting': 1488L, 'Failed': 19L, 'Running': 3725L, 'Done': 5360L, 'Stalled': 35L, 'Matched': 0}}, 'Records': [['', 'Unknown', 'Unknown', 'Tier-2', 'NoMask', 0, 0, 0, 0, 0, 1L, 0, 0, 0, 0, '0.0', 'Idle'], ['LCG.UKI-NORTHGRID-LANCS-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 15L, 0, 20L, 0, 308L, 0, 0, '100.0', 'Good'], ['VAC.UKI-SOUTHGRID-BHAM-HEP.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 0, 0, 8L, 0, 0, '100.0', 'Good'], ['CLOUD.CERN-PROD.ch', 'CLOUD', 'ch', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 0, 0, 9L, 0, 0, '100.0', 'Good'], ['VAC.UKI-LT2-UCL-HEP.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 23L, 0, 0, 0, 187L, 0, 0, '100.0', 'Good'], ['CLOUD.UKI-GridPP-Cloud-IC.uk', 'CLOUD', 'uk', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 16L, 0, 31L, 0, 0, '100.0', 'Good'], ['LCG.UKI-NORTHGRID-MAN-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 11L, 0, 57L, 0, 211L, 0, 0, '100.0', 'Good'], ['VAC.UKI-SOUTHGRID-OX-HEP.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 275L, 0, 0, 0, 30L, 0, 0, '100.0', 'Good'], ['LCG.UKI-SOUTHGRID-BHAM-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 292L, 0, 19L, 0, 3L, 0, 0, '100.0', 'Good'], ['LCG.UKI-LT2-QMUL.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 513L, 31L, 564L, 0, 2L, '99.6', 'Good'], ['Multiple', 'Unknown', 'Unknown', 'Tier-2', 'NoMask', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0.0', 'Idle'], ['LCG.NCG-INGRID-PT.pt', 'LCG', 'pt', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 7L, 0, 17L, 0, 0, '100.0', 'Good'], ['LCG.UKI-SOUTHGRID-BRIS-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 0, 0, 174L, 0, 0, '100.0', 'Good'], ['LCG.UKI-SOUTHGRID-CAM-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 19L, 0, 0, 0, 187L, 0, 0, '100.0', 'Good'], ['CLOUD.Datacentred.uk', 'CLOUD', 'uk', 'Tier-2', 'Active', 0, 0, 0, 27L, 0, 0, 0, 0, 0, 0, '0.0', 'Idle'], ['VAC.UKI-LT2-RHUL.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 129L, 0, 0, 0, 30L, 0, 0, '100.0', 'Good'], ['LCG.UKI-LT2-Brunel.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 19L, 0, 371L, 0, 515L, 0, 5L, '99.0', 'Good'], ['LCG.EFDA-JET.uk', 'LCG', 'uk', 'Tier-2', 'Banned', 0, 264L, 0, 0, 0, 0, 0, 0, 0, 0, '0.0', 'Idle'], ['LCG.UKI-SCOTGRID-GLASGOW.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 23L, 0, 390L, 0, 317L, 0, 0, '100.0', 'Good'], ['VAC.UKI-NORTHGRID-MAN-HEP.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 4L, 0, 0, 0, 223L, 0, 0, '100.0', 'Good'], ['VAC.UKI-SCOTGRID-GLASGOW.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 0, 0, 5L, 0, 0, '100.0', 'Good'], ['LCG.UKI-NORTHGRID-LIV-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 12L, 0, 85L, 0, 239L, 0, 0, '100.0', 'Good'], ['LCG.UKI-LT2-RHUL.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 131L, 0, 324L, 0, 313L, 0, 1L, '99.7', 'Good'], ['LCG.GRIF.fr', 'LCG', 'fr', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0.0', 'Idle'], ['LCG.CA-ALBERTA-WESTGRID-T2.ca', 'LCG', 'ca', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 32L, 0, 13L, 0, 0, '100.0', 'Good'], ['LCG.INFN-T1.it', 'LCG', 'it', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 0, 0, 2L, 0, 0, '100.0', 'Good'], ['LCG.UKI-SOUTHGRID-SUSX.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 2L, 0, 2L, 0, 0, '100.0', 'Good'], ['LCG.UKI-NORTHGRID-SHEF-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 280L, 0, 128L, 4L, 110L, 0, 3L, '97.3', 'Good'], ['LCG.CA-MCGILL-CLUMEQ-T2.ca', 'LCG', 'ca', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 10L, 0, 4L, 0, 0, '100.0', 'Good'], ['LCG.UKI-SCOTGRID-ECDF.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0.0', 'Idle'], ['LCG.UKI-LT2-IC-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 574L, 0, 459L, 0, 4L, '99.1', 'Good'], ['LCG.BelGrid-UCL.be', 'LCG', 'be', 'Tier-2', 'Active', 0, 0, 0, 0, 0, 0, 0, 1L, 0, 0, '100.0', 'Good'], ['LCG.RAL-LCG2.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 22L, 0, 407L, 0, 385L, 0, 4L, '99.0', 'Good'], ['LCG.UKI-SOUTHGRID-OX-HEP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 19L, 0, 224L, 0, 219L, 0, 0, '100.0', 'Good'], ['VAC.UKI-SOUTHGRID-CAM-HEP.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 18L, 0, 0, 0, 6L, 0, 0, '100.0', 'Good'], ['LCG.UKI-SCOTGRID-DURHAM.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 19L, 0, 571L, 0, 407L, 0, 0, '100.0', 'Good'], ['VAC.UKI-NORTHGRID-LIV-HEP.uk', 'VAC', 'uk', 'Tier-2', 'Active', 0, 0, 0, 22L, 0, 0, 0, 194L, 0, 0, '100.0', 'Good'], ['LCG.UKI-SOUTHGRID-RALPP.uk', 'LCG', 'uk', 'Tier-2', 'Active', 0, 0, 0, 20L, 0, 24L, 0, 233L, 0, 0, '100.0', 'Good']]}} Cheers, ivan
On 21 Jul 2017, at 14:30, Simon Fayer <simon.fayer05@imperial.ac.uk> wrote:
Hi Steve,
Yes, there isn't a pre-made interface class but it's accessible using the generic RPC client... Here is a short script which prints it out in its raw form:
#!/usr/bin/env python from DIRAC.Core.Base import Script Script.parseCommandLine(ignoreErrors=True) from DIRAC.Core.DISET.RPCClient import RPCClient adminClient = RPCClient('WorkloadManagement/WMSAdministrator', timeout=60) print adminClient.getSiteSummaryWeb({}, # Select Dict [], # Sort List 0, -1) # First Item, Max Items
On Fri, Jul 21, 2017 at 11:55:35AM +0000, Steve Lloyd wrote:
Hi, Is it possible to get the Site Summary information (https://dirac.gridpp.ac.uk/DIRAC/GridPP/gridpp_user/jobs/SiteSummary/display) programatically?
-- Ivan Reid (ivan.reid@[brunel.ac.uk|cern.ch]) Engineering, Design & Physical Sciences CMS Collaboration, Brunel University London. Room TOWD405 CERN, Room 40-1-B12