Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
More documentation and clerical fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahbishop committed Jan 11, 2010
1 parent 45e2f0f commit 8d81ea2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
14 changes: 7 additions & 7 deletions monitoring/nagios/nimbus_nagios_data_processing.py
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
33 changes: 17 additions & 16 deletions monitoring/nagios/nimbus_query_mds.py
Expand Up @@ -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'
Expand Down Expand Up @@ -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__)

Expand Down
3 changes: 1 addition & 2 deletions monitoring/nagios/nimbus_register_mds.py
Expand Up @@ -35,15 +35,14 @@
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
# be used in the subprocess.Popen call below without error

def mdsRegister():
try:

if(os.path.exists(PID_PATH)):
try:
pidFile = open(PID_PATH,"r")
Expand Down

0 comments on commit 8d81ea2

Please sign in to comment.