Ignore:
Timestamp:
11/19/13 11:13:07 (11 years ago)
Author:
sanmai
Message:
  • Make port_number specified as command line parameter. For simplicity, there is no

default value anymore, for now.

File:
1 edited

Legend:

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

    r4043 r4047  
    99OAI_namespace = "http://www.openarchives.org/OAI/2.0/"
    1010command_line_parameters = [("-h", "host",),
    11                            ("-u", "http_path",)]
     11                           ("-u", "http_path",),
     12                           ("-p", "port_number",)]
    1213
    13 # 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                             http_path) :
     16                            http_path,
     17                            port_number) :
    1718
    1819    http_paths = (http_path,) # X- use frozenset
    1920
     21    ## Warning: check of validity of returned data relies on the XML namespace OAI_NAMESPACE of the returned XML markup.
    2022    valid_root_element_tag  = "{%s}OAI-PMH" % (OAI_namespace)
    2123   
    22     if host.count(':') == 1:
    23         host, port = host.split(':')
    24     else:
    25         port = 80
    26     # Check status for all http_paths.
     24    ## Check status for all http_paths.
    2725    results = \
    2826        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
    2927                                                                      http_path                 = http_path,
    3028                                                                      HTTP_method               = 'GET',
    31                                                                       port_number               = port,
     29                                                                      port_number               = port_number,
    3230                                                                      authorize                 = True,
    3331                                                                      validator                 = generic_tla_monitoring.check_XML_validity,
     
    3634            http_paths)   
    3735   
    38     generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
     36    generic_tla_monitoring.nagios_return_complex(results,
     37                                                 reporter = special_plugin_description)
    3938
    4039if __name__ == "__main__" :
Note: See TracChangeset for help on using the changeset viewer.