diff --git a/monitoring/nagios/nimbus_nagios_data_processing.py b/monitoring/nagios/nimbus_nagios_data_processing.py index 25eb162c..56590a85 100755 --- a/monitoring/nagios/nimbus_nagios_data_processing.py +++ b/monitoring/nagios/nimbus_nagios_data_processing.py @@ -70,10 +70,10 @@ def __init__(self, callingClass): TIME_WINDOW = 300 class NagiosPerfDataProcessor(PluginObject): -""" This class takes all the various snippets of XML from the Nagios service-performance-file + """ This class takes all the various snippets of XML from the Nagios service-performance-file and aggregates them into a single, well formed XML document that can be utilized by our Nimbus MDS Aggregator -""" + """ def __init__(self): PluginObject.__init__(self,self.__class__.__name__) self.parser = make_parser() @@ -149,11 +149,11 @@ def parse(self): class ResourceHandler(ContentHandler): -""" - This class implements the SAX API functions 'startElement', 'endElement' and 'characters' - It is also intimately tied to the XML format used by the client side plugins -""" - def __init__(self): + """ + This class implements the SAX API functions 'startElement', 'endElement' and 'characters' + It is also intimately tied to the XML format used by the client side plugins + """ + def __init__(self): self.isResource = False self.isEntry = False diff --git a/monitoring/nagios/nimbus_query_mds.py b/monitoring/nagios/nimbus_query_mds.py index f6ba94ad..7480444b 100755 --- a/monitoring/nagios/nimbus_query_mds.py +++ b/monitoring/nagios/nimbus_query_mds.py @@ -35,22 +35,26 @@ import subprocess from subprocess import * +SERVER_ADDRESS = "https://vmcgs29.phys.uvic.ca:8443/wsrf/services/DefaultIndexService" +XML_ROOT_TAG = "ROOT" + class Loggable: -""" A simple base class to encapsulate useful logging features - Meant to be derived from + """ A simple base class to encapsulate useful logging features - Meant to be derived from -""" - def __init__(self, callingClass): - self.logString = StringIO() + """ + def __init__(self, callingClass): + + self.logString = StringIO() - self.logger = logging.getLogger(callingClass) - self.logger.setLevel(logging.INFO) - formatter = logging.Formatter('%(asctime)s ; %(name)s ; %(levelname)s ; %(message)s') + self.logger = logging.getLogger(callingClass) + self.logger.setLevel(logging.INFO) + formatter = logging.Formatter('%(asctime)s ; %(name)s ; %(levelname)s ; %(message)s') - errorOutputHndlr = logging.StreamHandler(sys.stderr) - errorOutputHndlr.setFormatter(formatter) - errorOutputHndlr.setLevel(logging.ERROR) + errorOutputHndlr = logging.StreamHandler(sys.stderr) + errorOutputHndlr.setFormatter(formatter) + errorOutputHndlr.setLevel(logging.ERROR) - self.logger.addHandler(errorOutputHndlr) + self.logger.addHandler(errorOutputHndlr) # This class implements the SAX API functions 'startElement', 'endElement' and 'characters' @@ -105,14 +109,11 @@ def __str__(self): return repr(self.value) -SERVER_ADDRESS = "https://gridsn.phys.uvic.ca:8443/wsrf/services/DefaultIndexService" -XML_ROOT_TAG = "ROOT" - class MDSResourceQuery(Loggable): -""" This class handles all the details of querying the MDS to retrieve XML then process the text + """ This class handles all the details of querying the MDS to retrieve XML then process the text into a useful data structure for further use. This includes post querying transformation of the Network Pools information to provide the "Available Slots" information -""" + """ def __init__(self): Loggable.__init__(self,self.__class__.__name__) diff --git a/monitoring/nagios/nimbus_register_mds.py b/monitoring/nagios/nimbus_register_mds.py index 18ceeb65..98efe39d 100755 --- a/monitoring/nagios/nimbus_register_mds.py +++ b/monitoring/nagios/nimbus_register_mds.py @@ -35,7 +35,7 @@ REG_FILE = "mdsVirtReg.xml" #Update this for your respective server location/address -SERVER_ADDRESS = "https://gridsn.phys.uvic.ca:8443/wsrf/services/DefaultIndexService" +SERVER_ADDRESS = "https://vmcgs29.phys.uvic.ca:8443/wsrf/services/DefaultIndexService" PID_PATH = "/tmp/nimbusMDSReg.pid" # Since this script is NOT invoked by NAGIOS as a plug-in, environment variables may @@ -43,7 +43,6 @@ def mdsRegister(): try: - if(os.path.exists(PID_PATH)): try: pidFile = open(PID_PATH,"r")