#!/usr/bin/env python
##############################################################################
#
# NAME:        CREAMCE-probe
#
# FACILITY:    SAM (Service Availability Monitoring)
#
# COPYRIGHT:
#         Copyright (c) 2009, Members of the EGEE Collaboration.
#         http://www.eu-egee.org/partners/
#         Licensed under the Apache License, Version 2.0.
#         http://www.apache.org/licenses/LICENSE-2.0
#         This software is provided "as is", without warranties
#         or conditions of any kind, either express or implied.
#
# DESCRIPTION:
#
#         CREAM CE probe.
#
# AUTHORS:     Konstantin Skaburskas, CERN
#
# CREATED:     15-Mar-2009
#
# NOTES:
#
# MODIFIED:
#    2009-12-07 : Konstantin Skaburskas
#         - using 'gridmon' and 'gridmetrics' packages after merging 
#           'gridmonsam' with 'gridmon'
##############################################################################

"""
CREAM CE probe.

CREAM CE probe.

Konstantin Skaburskas <konstantin.skaburskas@cern.ch>, CERN
SAM (Service Availability Monitoring)
"""

import sys

try:
    from gridmon import probe
    from creammetrics.CreamMetrics import CEGenericMetrics as CE
except ImportError,e:
    summary = "UNKNOWN: Error loading modules : %s" % (e)
    sys.stdout.write(summary+'\n')
    sys.stdout.write(summary+'\nsys.path: %s\n'% str(sys.path))
    sys.exit(3)    

class CREAMCEMetrics(CE):
    def __init__(self, tuples):
        CE.__init__(self, tuples, 'CREAMCE')

runner = probe.Runner(CREAMCEMetrics, probe.ProbeFormatRenderer())
sys.exit(runner.run(sys.argv))
