Changeset 3555 for monitoring


Ignore:
Timestamp:
09/12/13 15:37:28 (11 years ago)
Author:
sanmai
Message:
  • Add plugin for LAT PostgreSQL server.
  • Rework generic HTTP check to allow port number specification.
  • Some renaming/clarification.
Location:
monitoring/plugins/mpi
Files:
16 edited

Legend:

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

    r3268 r3555  
    1212
    1313
    14 def special_main_subroutine(host, URL) :
    15     UP_URLs = (URL,) # X- use frozenset
     14def special_main_subroutine(host, http_path) :
     15    http_paths = (http_path,) # X- use frozenset
    1616   
    1717    # Check status for all UP_URLs.
    1818    results = \
    19         map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    20                                                                    UP_URL                    = UP_URL,
     19        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     20                                                                   http_path                    = http_path,
    2121                                                                   HTTP_method               = "GET",
     22                                                                   port_number               = 80,
     23                                                                   authorize                 = True,
    2224                                                                   validator                 = generic_tla_monitoring.check_HTML_wellformedness,
    2325                                                                   special_plugin_file_name  = special_plugin_file_name),
    24             UP_URLs)   
     26            http_paths)   
    2527   
    2628    generic_tla_monitoring.nagios_return_complex(results,
  • monitoring/plugins/mpi/check_clarin_discojuice_html.py

    r3270 r3555  
    1111
    1212
    13 def special_main_subroutine(host, URL) :
     13def special_main_subroutine(host, http_path) :
    1414
    15     UP_URLs = (URL,)
     15    http_paths = (http_path,)
    1616   
    17     # Check status for all UP_URLs.
     17    # Check status for all http_path.
    1818    results = \
    19         map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    20                                                                    UP_URL                    = UP_URL,
    21                                                                    HTTP_method               = "GET",
    22                                                                    validator                 = generic_tla_monitoring.check_HTML_wellformedness,
    23                                                                    special_plugin_file_name  = special_plugin_file_name),
    24                   UP_URLs)   
     19        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     20                                                                      http_path                 = http_path,
     21                                                                      HTTP_method               = "GET",
     22                                                                      port_number               = 80,
     23                                                                      authorize                 = True,
     24                                                                      validator                 = generic_tla_monitoring.check_HTML_wellformedness,
     25                                                                      special_plugin_file_name  = special_plugin_file_name),
     26                  http_paths)   
    2527   
    2628    generic_tla_monitoring.nagios_return_complex(results,
  • monitoring/plugins/mpi/check_clarin_discojuice_json.py

    r3382 r3555  
    88special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111
    1212
    13 def special_main_subroutine(host, URL) :
     13def special_main_subroutine(host, http_path) :
    1414
    15     UP_URLs = (URL,)
     15    http_paths = (http_path,)
    1616   
    17     # Check status for all UP_URLs.
     17    # Check status for all http_paths.
    1818    results = \
    19         map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    20                                                                    UP_URL                    = UP_URL,
    21                                                                    HTTP_method               = "GET",
    22                                                                    validator                 = generic_tla_monitoring.check_JSON_wellformedness,
    23                                                                    special_plugin_file_name  = special_plugin_file_name),
    24             UP_URLs)
     19        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     20                                                                      http_path                 = http_path,
     21                                                                      HTTP_method               = "GET",
     22                                                                      port_number               = 80,
     23                                                                      authorize                 = True,
     24                                                                      validator                 = generic_tla_monitoring.check_JSON_wellformedness,
     25                                                                      special_plugin_file_name  = special_plugin_file_name),
     26            http_paths)
    2527   
    2628
  • monitoring/plugins/mpi/check_clarin_vlo.py

    r3267 r3555  
    88
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111
    12 def special_main_subroutine(host, URL) :
     12def special_main_subroutine(host, http_path) :
    1313    #result = test_case(host);
    1414    #result = check_condition(host)
    1515    #generic_tla_monitoring.nagios_return(result['code'], result['message'])
    1616
    17     UP_URLs = (URL,) # X- use frozenset
     17    http_path = (http_path,) # X- use frozenset
    1818   
    19     # Check status for all UP_URLs.
     19    # Check status for all http_path.
    2020    results = \
    21         map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    22                                                                    UP_URL                    = UP_URL,
    23                                                                    HTTP_method               = "GET",
    24                                                                    validator                 = generic_tla_monitoring.check_HTML_wellformedness,
    25                                                                    special_plugin_file_name  = special_plugin_file_name),
    26             UP_URLs)
     21        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     22                                                                      http_path                 = http_path,
     23                                                                      HTTP_method               = "GET",
     24                                                                      port_number               = 80,
     25                                                                      authorize                 = True,
     26                                                                      validator                 = generic_tla_monitoring.check_HTML_wellformedness,
     27                                                                      special_plugin_file_name  = special_plugin_file_name),
     28            http_path)
    2729   
    2830    generic_tla_monitoring.nagios_return_complex(results,
  • monitoring/plugins/mpi/check_lat_annex.py

    r3270 r3555  
    88special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111
    1212
    13 def special_main_subroutine(host, URL) :
     13def special_main_subroutine(host,
     14                            http_path) :
    1415
    15     UP_URLs = (URL,) # X- use frozenset
     16    http_paths = (http_path,) # X- use frozenset
    1617   
    17     # Check status for all UP_URLs.
    18     results = map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    19                                                                          UP_URL                    = UP_URL,
    20                                                                          HTTP_method               = "GET",
    21                                                                          validator                 = generic_tla_monitoring.check_HTML_wellformedness,
    22                                                                          special_plugin_file_name  = special_plugin_file_name),
    23                   UP_URLs)   
     18    # Check status for all http_paths.
     19    results = \
     20        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     21                                                                      http_path                = http_path,
     22                                                                      HTTP_method               = "GET",
     23                                                                      port_number               = 80,
     24                                                                      authorize                 = True,
     25                                                                      validator                 = generic_tla_monitoring.check_HTML_wellformedness,
     26                                                                      special_plugin_file_name  = special_plugin_file_name),
     27            http_paths)   
    2428   
    2529    generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
  • monitoring/plugins/mpi/check_lat_avatech_clam.py

    r3385 r3555  
    88special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111valid_root_element_tag = "clam"
    1212
    13 def special_main_subroutine(host, URL) :
     13def special_main_subroutine(host, http_path) :
    1414
    15     UP_URLs = (URL,) # X- use frozenset
     15    http_paths = (http_path,) # X- use frozenset
    1616   
    17     # Check status for all UP_URLs.
     17    # Check status for all http_paths.
    1818    results = \
    19       map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    20                                                                  UP_URL                    = UP_URL,
    21                                                                  HTTP_method               = "GET",
    22                                                                  validator                 = generic_tla_monitoring.check_XML_validity,
    23                                                                  valid_root_element_tag    = valid_root_element_tag,
    24                                                                  special_plugin_file_name  = special_plugin_file_name),
    25           UP_URLs)   
     19        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     20                                                                   http_path                 = http_path,
     21                                                                   HTTP_method               = "GET",
     22                                                                   port_number               = 80,
     23                                                                   authorize                 = True,
     24                                                                   validator                 = generic_tla_monitoring.check_XML_validity,
     25                                                                   valid_root_element_tag    = valid_root_element_tag,
     26                                                                   special_plugin_file_name  = special_plugin_file_name),
     27          http_paths)   
    2628   
    2729    generic_tla_monitoring.nagios_return_complex(results,
  • monitoring/plugins/mpi/check_lat_cql_endpoint.py

    r3385 r3555  
    99CQL_namespace = "http://www.loc.gov/zing/srw/"
    1010command_line_parameters = [("-h", "host",),
    11                            ("-u", "URL",)]
     11                           ("-u", "http_path",)]
    1212
    1313# Warning: check of validity of returned data relies on the XML namespace CQL_NAMESPACE of the returned XML markup.
    1414
    1515def special_main_subroutine(host,
    16                             URL) :
     16                            http_path) :
    1717   
    18     UP_URLs = (URL,) # X- allow for multiple URLs?
     18    http_paths = (http_path,) # X- allow for multiple URLs?
    1919
    2020    valid_root_element_tag = "{%s}explainResponse" % (CQL_namespace)
    2121   
    22     # Check status for all UP_URLs.
     22    # Check status for all http_paths.
    2323    results = \
    24         map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    25                                                                    UP_URL                    = UP_URL,
    26                                                                    HTTP_method               = 'GET',
    27                                                                    validator                 = generic_tla_monitoring.check_XML_validity,
    28                                                                    valid_root_element_tag    = valid_root_element_tag,
    29                                                                    special_plugin_file_name  = special_plugin_file_name),
    30             UP_URLs)
     24        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     25                                                                      http_path                 = http_path,
     26                                                                      HTTP_method               = 'GET',
     27                                                                      port_number               = 80,
     28                                                                      authorize                 = True,
     29                                                                      validator                 = generic_tla_monitoring.check_XML_validity,
     30                                                                      valid_root_element_tag    = valid_root_element_tag,
     31                                                                      special_plugin_file_name  = special_plugin_file_name),
     32            http_paths)
    3133   
    3234    generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
  • monitoring/plugins/mpi/check_lat_dobes.py

    r3384 r3555  
    88special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111
    1212
    13 def special_main_subroutine(host, URL) :
     13def special_main_subroutine(host, http_path) :
    1414
    15     UP_URLs = (URL,)
     15    http_paths = (http_path,)
    1616   
    1717    # Check status for all UP_URLs.
    1818    results = \
    19         map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = host,
    20                                                                    UP_URL                    = UP_URL,
    21                                                                    HTTP_method               = "GET",
     19        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     20                                                                   http_path                    = http_path,
     21                                                                   HTTP_method               = "GET",
     22                                                                   port_number               = 80,
     23                                                                   authorize                 = True,
    2224                                                                   validator                 = generic_tla_monitoring.check_HTML_wellformedness,
    2325                                                                   special_plugin_file_name  = special_plugin_file_name),
    24                   UP_URLs)   
     26                  http_paths)   
    2527   
    2628    generic_tla_monitoring.nagios_return_complex(results,
  • monitoring/plugins/mpi/check_lat_handle.py

    r3388 r3555  
    88special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111IMDI_namespace = "http://www.mpi.nl/IMDI/Schema/IMDI"
    1212
    1313# Warning: old checking condition "if 300 <= r1.status and r1.status < 400:" X-
    1414
    15 def special_main_subroutine(host, URL) :
     15def special_main_subroutine(host, http_path) :
    1616    #result = test_case(host);
    1717    #result = check_condition(host)
     
    2020    valid_root_element_tag = "{%s}METATRANSCRIPT" % (IMDI_namespace)
    2121
    22     UP_URLs = (URL,) # X- use frozenset
     22    http_paths = (http_path,) # X- use frozenset
    2323    # /1839/00-0000-0000-0000-0000-4
    2424    # POST hdl=1839%2F00-0000-0000-0000-0009-4&auth=x&noredirect=
    2525   
    26     # Check status for all UP_URLs.
     26    # Check status for all http_paths.
    2727    results = \
    28       map(lambda UP_URL : generic_tla_monitoring.check_condition(host                      = 'hdl.handle.net', # X- host
    29                                                                  UP_URL                    = UP_URL,
    30                                                                  HTTP_method               = 'POST',
    31                                                                  validator                 = generic_tla_monitoring.check_XML_validity,
    32                                                                  valid_root_element_tag    = valid_root_element_tag,                                                                 special_plugin_file_name = special_plugin_file_name),
    33                            UP_URLs)   
     28        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = 'hdl.handle.net', # X- host
     29                                                                      http_path                 = http_path,
     30                                                                      HTTP_method               = 'POST',
     31                                                                      port_number               = 80,
     32                                                                      authorize                 = True,
     33                                                                      validator                 = generic_tla_monitoring.check_XML_validity,
     34                                                                      valid_root_element_tag    = valid_root_element_tag,                                                                 
     35                                                                      special_plugin_file_name  = special_plugin_file_name),
     36                           http_paths)   
    3437   
    3538    generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
  • monitoring/plugins/mpi/check_lat_imdi.py

    r3389 r3555  
    88special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111
    12 def special_main_subroutine(host, URL) :
     12def special_main_subroutine(host, http_path) :
    1313
    14     UP_URLs = (URL,)
    15     #UP_URLs_encoded  = urllib.parse.quote_plus()
     14    http_paths = (http_path,)
     15    #http_paths_encoded  = urllib.parse.quote_plus()
    1616
    1717    # X- use frozenset
     
    1919    # new: /ds/imdi_browser/viewcontroller?request=view&nodeid=MPI299144%23
    2020
    21     # Check status for all UP_URLs.
     21    # Check status for all http_paths.
    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),
    28           UP_URLs)
     23        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     24                                                                      http_path                 = http_path,
     25                                                                      HTTP_method               = 'GET',
     26                                                                      port_number              = 80,
     27                                                                      authorize                = True,
     28                                                                      validator                = generic_tla_monitoring.check_HTML_wellformedness,
     29                                                                      special_plugin_file_name  = special_plugin_file_name),
     30          http_paths)
    2931   
    3032    generic_tla_monitoring.nagios_return_complex(results,
  • monitoring/plugins/mpi/check_lat_lamus.py

    r3270 r3555  
    22
    33import generic_tla_monitoring
    4 import os, pdb
     4import os, pdb, sys, inspect, traceback
    55
    66
     
    88special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111
    1212
    13 def special_main_subroutine(host, URL) :
     13def special_main_subroutine(host, http_path) :
    1414
    15     UP_URLs = (URL,) # X- use frozenset
     15    http_paths = (http_path,) # X- use frozenset
    1616   
    17     # Check status for all UP_URLs.
    18     results = map(lambda UP_URL : generic_tla_monitoring.check_condition(host          = host,
    19                                                                          UP_URL        = UP_URL,
    20                                                                          HTTP_method   = 'GET',
    21                                                                          validator     = generic_tla_monitoring.check_HTML_wellformedness,
    22                                                                          special_plugin_file_name = special_plugin_file_name),
    23                   UP_URLs)
     17    ## Check status for all http_paths.
     18    results = \
     19        map(lambda http_path : generic_tla_monitoring.check_condition(host                     = host,
     20                                                                      http_path                = http_path,
     21                                                                      HTTP_method              = 'GET',
     22                                                                      port_number              = 80,
     23                                                                      authorize                = True,
     24                                                                      validator                = generic_tla_monitoring.check_HTML_wellformedness,
     25                                                                      special_plugin_file_name = special_plugin_file_name),
     26            http_paths)
    2427   
    2528    generic_tla_monitoring.nagios_return_complex(results,
  • monitoring/plugins/mpi/check_lat_lexus.py

    r3269 r3555  
    55
    66
    7 special_plugin_description      = "Lexus"
    8 special_plugin_file_name        = os.path.basename(__file__)
     7special_plugin_description = "Lexus"
     8special_plugin_file_name = os.path.basename(__file__)
    99command_line_parameters = [("-h", "host",),
    10                            ("-u", "URL",)]
     10                           ("-u", "http_path",)]
    1111
    1212
    13 def special_main_subroutine(host, URL) :
     13def special_main_subroutine(host, http_path) :
    1414
    15     UP_URLs          = (URL,) # X- use frozenset
     15    http_paths = (http_path,) # X- use frozenset
    1616   
    17     # Check status for all UP_URLs.
    18     results          = map(lambda UP_URL : generic_tla_monitoring.check_condition(host          = host,
    19                                                                                   UP_URL        = UP_URL,
    20                                                                                   HTTP_method   = 'GET',
    21                                                                                   validator     = generic_tla_monitoring.check_HTML_wellformedness,
    22                                                                                   special_plugin_file_name = special_plugin_file_name),
    23                            UP_URLs)
     17    # Check status for all http_paths.
     18    results = \
     19        map(lambda http_path : generic_tla_monitoring.check_condition(host                     = host,
     20                                                                      http_path                = http_path,
     21                                                                      HTTP_method              = 'GET',
     22                                                                      port_number              = 80,
     23                                                                      authorize                = True,
     24                                                                      validator                = generic_tla_monitoring.check_HTML_wellformedness,
     25                                                                      special_plugin_file_name = special_plugin_file_name),
     26            http_paths)
    2427   
    25     generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
     28    generic_tla_monitoring.nagios_return_complex(results,
     29                                                 reporter = special_plugin_description)
    2630
    2731if __name__ == "__main__" :
  • monitoring/plugins/mpi/check_lat_oai_endpoint.py

    r3385 r3555  
    55
    66
    7 special_plugin_description      = "OAI-PMH endpoint"
    8 special_plugin_file_name        = os.path.basename(__file__)
    9 OAI_namespace                   = "http://www.openarchives.org/OAI/2.0/"
     7special_plugin_description = "OAI-PMH endpoint"
     8special_plugin_file_name = os.path.basename(__file__)
     9OAI_namespace = "http://www.openarchives.org/OAI/2.0/"
    1010command_line_parameters = [("-h", "host",),
    11                            ("-u", "URL",)]
     11                           ("-u", "http_path",)]
    1212
    1313# Warning: check of validity of returned data relies on the XML namespace OAI_NAMESPACE of the returned XML markup.
    1414
    1515def special_main_subroutine(host,
    16                             URL) :
     16                            http_path) :
    1717
    18     UP_URLs = (URL,) # X- use frozenset
     18    http_paths = (http_path,) # X- use frozenset
    1919
    2020    valid_root_element_tag  = "{%s}OAI-PMH" % (OAI_namespace)
    2121   
    22     # Check status for all UP_URLs.
    23     results          = 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),
    29                            UP_URLs)   
     22    # Check status for all http_paths.
     23    results = \
     24        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
     25                                                                      http_path                 = http_path,
     26                                                                      HTTP_method               = 'GET',
     27                                                                      port_number               = 80,
     28                                                                      authorize                 = True,
     29                                                                      validator                 = generic_tla_monitoring.check_XML_validity,
     30                                                                      valid_root_element_tag    = valid_root_element_tag,
     31                                                                      special_plugin_file_name  = special_plugin_file_name),
     32            http_paths)   
    3033   
    3134    generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
  • monitoring/plugins/mpi/generic_tla_monitoring.py

    r3391 r3555  
    44import simplejson as json
    55import pwd, os
    6 
    76
    87nagios_codes    = {
     
    227226                }
    228227
    229 
    230228def check_condition(host,
    231                     UP_URL,
     229                    http_path,
    232230                    HTTP_method,
    233                     validator,
     231                    port_number,
     232                    authorize,
     233                    validator,
    234234                    **validator_arguments) :
    235235
     236    #pdb.set_trace()
     237    # X- remove implicit argument values
     238    #if port_number is None : port_number = 80
     239    #if authorize is None : authorize = True
     240
    236241    def handle_connection_failure(problem_description) :
    237         err_log_file_path = os.path.normpath("/tmp/" + special_plugin_file_name + "_err_connection_failure__" + UP_URL.replace('/' , '%2F') + "__" + timestamp + ".log")
     242        err_log_file_path = os.path.normpath("/tmp/" + special_plugin_file_name + "_err_connection_failure__" + http_path.replace('/' , '%2F') + "__" + timestamp + ".log")
    238243
    239244        with open(name = err_log_file_path,
     
    243248    special_plugin_file_name = validator_arguments['special_plugin_file_name'] # X-
    244249   
    245     #UP_URL  = str(urllib.quote_plus(UP_URL))   
    246    
    247     timestamp                = datetime.datetime.today().isoformat()
    248    
    249     try :
    250         conn                 = httplib.HTTPConnection(host) # X- accomodate https?
    251 
    252         request              = conn.request(HTTP_method, UP_URL)
     250    #http_path  = str(urllib.quote_plus(http_path))   
     251   
     252    timestamp = datetime.datetime.today().isoformat()
     253   
     254    try :
     255        conn = httplib.HTTPConnection(host = host, port = port_number) # X- accomodate https?
     256
     257        request = conn.request(HTTP_method, http_path)
    253258    except :
    254         traceback_string     = traceback.format_exc()
     259        traceback_string = traceback.format_exc()
    255260
    256261        handle_connection_failure(traceback_string + "\nThis problem originates from location 1 in '" + special_plugin_file_name + "'.\n")
     
    284289            # X- Resolve redirect in case of HTTP status == 302
    285290                well_formed = validator(data                    = data,
    286                                          descriptive_string     = UP_URL,
    287                                          **validator_arguments) # ['validator_arguments'])
     291                                        descriptive_string     = http_path,
     292                                        **validator_arguments) # ['validator_arguments'])
    288293
    289294                if well_formed :
    290295                    return {
    291296                            "code"      : "OK",
    292                             "message"   : 'Host %s is up and returns well-formed data at "%s".' % (host, UP_URL)
     297                            "message"   : 'Host %s is up and returns well-formed data at "%s".' % (host, http_path)
    293298                           }
    294299                else :
    295300                    return {
    296301                            "code"      : "CRITICAL",
    297                             "message"   : 'Host %s is up but returns non-well-formed data at "%s".' % (host, UP_URL)
     302                            "message"   : 'Host %s is up but returns non-well-formed data at "%s".' % (host, http_path)
    298303                            }
    299304
     
    303308                parsed_new_location_URL = urlparse.urlparse(new_location_URL)
    304309
    305                 return check_condition(parsed_new_location_URL.netloc,
    306                                        parsed_new_location_URL.path,
    307                                        HTTP_method,
    308                                        validator,
     310               
     311
     312                return check_condition(host        = parsed_new_location_URL.netloc,
     313                                       http_path   = parsed_new_location_URL.path,
     314                                       HTTP_method = HTTP_method,
     315                                       port_number = port_number,
     316                                       authorize   = authorize,
     317                                       validator   = validator,
    309318                                       **validator_arguments) # special_plugin_file_name = validator_arguments['special_plugin_file_name']
    310319
     320            elif response.status == httplib.UNAUTHORIZED and authorize == False :
     321                return {
     322                        "code"      : "OK",
     323                        "message"   : 'Host %s is up and requests authorization at "%s".' % (host, http_path)
     324                       }
     325
    311326            else :
     327                #pdb.set_trace()
    312328                handle_connection_failure("Unreachable URL! HTTP response code: " + str(response.status) +
    313329                                            "\nThis problem originates from location 3 in '" + special_plugin_file_name + "'.\n")
     
    315331                return {
    316332                        "code"      : "CRITICAL",
    317                         "message"   : 'Host %s has a problem with the URL path component "%s".' % (host, UP_URL)
     333                        "message"   : 'Host %s has a problem with the URL path component "%s".' % (host, http_path)
    318334                       }
    319335
  • monitoring/plugins/mpi/integration_test.R

    r3313 r3555  
    33
    44checks_info <-
    5     utils:::read.table("plugins_hosts_services.tab",
     5    utils:::read.table("plugins_hosts_services2.tab",
    66                       sep       = "\t",
    77                       header    = TRUE,
     
    4747                     '-d', checks_info[test_index,]$`-d`);
    4848    }
     49    if (!base:::is.na(checks_info[test_index,]$`-p`)) {
     50        command_line <-
     51            base:::c(command_line,
     52                     '-p', checks_info[test_index,]$`-p`);
     53    }
     54
    4955
    5056    test_output <-
    51         base:::system2(command = "python2",
     57        base:::system2(command = "python",
    5258                        args    = command_line,
    5359                        stdout  = TRUE,
  • monitoring/plugins/mpi/plugins_hosts_services.tab

    r3384 r3555  
    1 file name       description     -h      protocol        -u      -b      -d
    2 check_lat_cql_endpoint.py       CQL endpoint    cqlservlet.mpi.nl       http    '/'             
    3 check_lat_avatech_clam.py       AVATecH CLAM    catalog.clarin.eu       http    '/avatech/avatech_iais_fine_segmentation'               
    4 check_lat_lexus.py      Lexus   corpus1.mpi.nl  http    '/mpi/lexusDojo/'               
    5 check_lat_lamus.py      Lamus   corpus1.mpi.nl  http    '/jkc/lamus/lamusstart.jsp'             
    6 check_lat_imdi.py       IMDI browser (staging)  lux17.mpi.nl    http    '/ds/imdi_browser/viewcontroller?request=view&nodeid=MPI299144%23'             
    7 check_lat_imdi.py       IMDI browser (production)       corpus1.mpi.nl  http    '/ds/imdi_browser/viewcontroller?request=view&nodeid=MPI299144%23'             
    8 check_lat_handle.py     Handle  hdl.handle.net  http    '/?hdl=1839%2F00-0000-0000-0000-0000-4&auth=x'         
    9 check_lat_annex.py      Annex   corpus1.mpi.nl  http    '/ds/annex/runLoader?nodeid=MPI600401%23'               
    10 check_lat_oai_endpoint.py       OAI-PMH corpus1.mpi.nl  http    '/ds/oaiprovider/oai2?verb=Identify'           
    11 check_clarin_saml.py    SAML    infra.clarin.eu https   '/aai/clarin-sp-metadata.xml'           /srv/www/infra.clarin.eu/
    12 check_clarin_discojuice_html.py Discojuice HTML 1       catalog.clarin.eu       http    '/mw1/sds/discojuice'           
    13 check_clarin_discojuice_html.py Discojuice HTML 2       catalog.clarin.eu       http    '/mw2/sds/discojuice'           
    14 check_clarin_discojuice_json.py Discojuice JSON 1       catalog.clarin.eu       http    '/discojuice/metadata_clarin1.json'             
    15 check_clarin_discojuice_json.py Discojuice JSON 2       catalog.clarin.eu       http    '/discojuice/metadata_clarin2.json'             
    16 check_clarin_vlo.py     Virtual Language Observatory    catalog.clarin.eu       http    '/vlo/'         
    17 check_clarin_comp_reg.py        Component Registry      catalog.clarin.eu       http    '/ds/ComponentRegistry/'               
    18 check_clarin_ldap.py    LDAP directory  user.clarin.eu  ldap            'cn=Directory Manager'
    19 check_lat_dobes.py      DoBeS   dobes.mpi.nl http       '/'                     
     1file name       description     -h      protocol        -u      -b      -d      -p
     2check_lat_cql_endpoint.py       CQL endpoint    cqlservlet.mpi.nl       http    '/'                     
     3check_lat_avatech_clam.py       AVATecH CLAM    catalog.clarin.eu       http    '/avatech/avatech_iais_fine_segmentation'                       
     4check_lat_lexus.py      Lexus   corpus1.mpi.nl  http    '/mpi/lexusDojo/'                       
     5check_lat_lamus.py      Lamus   corpus1.mpi.nl  http    '/jkc/lamus/lamusstart.jsp'                     
     6check_lat_imdi.py       IMDI browser [staging]  lux17.mpi.nl    http    '/ds/imdi_browser/viewcontroller?request=view&nodeid=MPI299144%23'                     
     7check_lat_imdi.py       IMDI browser [production]       corpus1.mpi.nl  http    '/ds/imdi_browser/viewcontroller?request=view&nodeid=MPI299144%23'                     
     8check_lat_handle.py     Handle  hdl.handle.net  http    '/?hdl=1839%2F00-0000-0000-0000-0000-4&auth=x'                 
     9check_lat_annex.py      Annex   corpus1.mpi.nl  http    '/ds/annex/runLoader?nodeid=MPI600401%23'                       
     10check_lat_oai_endpoint.py       OAI-PMH corpus1.mpi.nl  http    '/ds/oaiprovider/oai2?verb=Identify'                   
     11check_clarin_saml.py    SAML    infra.clarin.eu https   '/aai/clarin-sp-metadata.xml'           /srv/www/infra.clarin.eu/       
     12check_clarin_discojuice_html.py Discojuice HTML 1       catalog.clarin.eu       http    '/mw1/sds/discojuice'                   
     13check_clarin_discojuice_html.py Discojuice HTML 2       catalog.clarin.eu       http    '/mw2/sds/discojuice'                   
     14check_clarin_discojuice_json.py Discojuice JSON 1       catalog.clarin.eu       http    '/discojuice/metadata_clarin1.json'                     
     15check_clarin_discojuice_json.py Discojuice JSON 2       catalog.clarin.eu       http    '/discojuice/metadata_clarin2.json'                     
     16check_clarin_vlo.py     Virtual Language Observatory    catalog.clarin.eu       http    '/vlo/'                 
     17check_clarin_comp_reg.py        Component Registry      catalog.clarin.eu       http    '/ds/ComponentRegistry/'                       
     18check_clarin_ldap.py    LDAP directory  user.clarin.eu  ldap            'cn=Directory Manager'         
     19check_lat_dobes.py      DoBeS   dobes.mpi.nl    http    '/'                     
     20check_lat_postgresql.py LAT PostgreSQL database server  lux08.mpi.nl    http    '/rest/'                        8984
Note: See TracChangeset for help on using the changeset viewer.