ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/ApmonIf.py
(Generate patch)

Comparing COMP/CRAB/python/ApmonIf.py (file contents):
Revision 1.7 by corvo, Fri Mar 31 13:36:26 2006 UTC vs.
Revision 1.8 by corvo, Mon Apr 3 08:58:22 2006 UTC

# Line 1 | Line 1
1 < import apmon
1 > import apmon, sys, common
2  
3   class ApmonIf:
4      """
# Line 23 | Line 23 | class ApmonIf:
23      def getApmonInstance(self):
24          if self.apm is None :
25              try:
26 <                apmonUrl = 'http://lxgate35.cern.ch:40808/ApMonConf'
27 <                print "Creating ApMon with " + apmonUrl
28 <                apmonInstance = apmon.ApMon(apmonUrl, apmon.Logger.WARNING)
26 >                apmonUrls = ["http://lxgate35.cern.ch:40808/ApMonConf", "http://monalisa.cacr.caltech.edu:40808/ApMonConf"]
27 >                apmInstance = apmon.ApMon(apmonUrls, apmon.Logger.FATAL);
28 >                if not apmInstance.initializedOK():
29 >                    print "It seems that ApMon cannot read its configuration. Setting the default destination"
30 >                apmInstance.setDestinations({'lxgate35.cern.ch:58884': {'sys_monitoring':0, 'general_info':0, 'job_monitoring':1, 'job_interval':300}});
31              except:
32 <                print "PIPPO"
33 <        return apmonInstance
32 >                exctype, value = sys.exc_info()[:2]
33 >                print "ApmonIf::getApmonInstance Exception raised %s Value: %s"%(exctype, value)
34 >                common.logger.message("ApmonIf::getApmonInstance Exception raised: %s %s"%(exctype, value))
35 >                return
36 >        return apmInstance
37          
38      def free(self):
39          self.apm.free()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines