Changeset 3385 for monitoring


Ignore:
Timestamp:
08/15/13 14:10:11 (11 years ago)
Author:
sanmai
Message:
  • Clean up XML namespace handling.
  • Fix check_lat_handle.py to use XML validation on the data, as it is IMDI not HTML.
Location:
monitoring/plugins/mpi
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • monitoring/plugins/mpi/check_lat_avatech_clam.py

    r3270 r3385  
    99command_line_parameters = [("-h", "host",),
    1010                           ("-u", "URL",)]
     11valid_root_element_tag = "clam"
    1112
    1213def special_main_subroutine(host, URL) :
     
    1920                                                                 UP_URL                    = UP_URL,
    2021                                                                 HTTP_method               = "GET",
    21                                                                  validator                 = generic_tla_monitoring.check_HTML_wellformedness,
     22                                                                 validator                 = generic_tla_monitoring.check_XML_validity,
     23                                                                 valid_root_element_tag    = valid_root_element_tag,
    2224                                                                 special_plugin_file_name  = special_plugin_file_name),
    2325          UP_URLs)   
  • monitoring/plugins/mpi/check_lat_cql_endpoint.py

    r3270 r3385  
    77special_plugin_description = "CQL endpoint"
    88special_plugin_file_name = os.path.basename(__file__)
    9 CQL_NAMESPACE = "http://www.loc.gov/zing/srw/"
     9CQL_namespace = "http://www.loc.gov/zing/srw/"
    1010command_line_parameters = [("-h", "host",),
    1111                           ("-u", "URL",)]
     
    1818    UP_URLs = (URL,) # X- allow for multiple URLs?
    1919
    20     valid_root_element_tag = "{%s}explainResponse" % (CQL_NAMESPACE)
     20    valid_root_element_tag = "{%s}explainResponse" % (CQL_namespace)
    2121   
    2222    # Check status for all UP_URLs.
  • monitoring/plugins/mpi/check_lat_handle.py

    r3270 r3385  
    99command_line_parameters = [("-h", "host",),
    1010                           ("-u", "URL",)]
     11IMDI_namespace = "http://www.mpi.nl/IMDI/Schema/IMDI"
    1112
    1213# Warning: old checking condition "if 300 <= r1.status and r1.status < 400:" X-
     
    1617    #result = check_condition(host)
    1718    #generic_tla_monitoring.nagios_return(result['code'], result['message'])
     19
     20    valid_root_element_tag  = "{%s}METATRANSCRIPT" % (OAI_namespace)
    1821
    1922    UP_URLs = (URL,) # X- use frozenset
  • monitoring/plugins/mpi/check_lat_imdi.py

    r3270 r3385  
    2121    # Check status for all UP_URLs.
    2222    results = \
    23       map(lambda UP_URL : generic_tla_monitoring.check_condition(host          = host,
    24                                                                  UP_URL        = UP_URL,
    25                                                                  HTTP_method   = 'GET',
    26                                                                  validator     = generic_tla_monitoring.check_HTML_wellformedness,
    27                                                                  special_plugin_file_name = special_plugin_file_name),
     23      map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
     24                                                                 UP_URL                    = UP_URL,
     25                                                                 HTTP_method               = 'GET',
     26                                                                 validator                 = generic_tla_monitoring.check_XML_validity,
     27                                                                 valid_root_element_tag    = valid_root_element_tag,
     28                                                                 special_plugin_file_name  = special_plugin_file_name),
    2829          UP_URLs)
    2930   
  • monitoring/plugins/mpi/check_lat_oai_endpoint.py

    r3284 r3385  
    77special_plugin_description      = "OAI-PMH endpoint"
    88special_plugin_file_name        = os.path.basename(__file__)
    9 OAI_NAMESPACE                   = "http://www.openarchives.org/OAI/2.0/"
     9OAI_namespace                   = "http://www.openarchives.org/OAI/2.0/"
    1010command_line_parameters = [("-h", "host",),
    1111                           ("-u", "URL",)]
     
    1818    UP_URLs = (URL,) # X- use frozenset
    1919
    20     valid_root_element_tag  = "{%s}OAI-PMH" % ("http://www.openarchives.org/OAI/2.0/")
     20    valid_root_element_tag  = "{%s}OAI-PMH" % (OAI_namespace)
    2121   
    2222    # Check status for all UP_URLs.
  • monitoring/plugins/mpi/generic_tla_monitoring.py

    r3382 r3385  
    7474                              descriptive_string,
    7575                              **kwargs) : # X-
     76
    7677    def special_validator(data,
    7778                          descriptive_string,
     
    8788        else :
    8889            return False
     90
     91    pdb.set_trace()
    8992
    9093    # X- Do PROPER wellformedness check - once the tools are availble.
Note: See TracChangeset for help on using the changeset viewer.