#!/usr/bin/python2 import generic_tla_monitoring import os, pdb special_plugin_description = "CQL endpoint" special_plugin_file_name = os.path.basename(__file__) CQL_namespace = "http://www.loc.gov/zing/srw/" command_line_parameters = [("-s", "scheme"), ("-h", "host",), ("-u", "http_path",), ("-p", "port_number",)] def special_main_subroutine(scheme, host, http_path, port_number) : http_paths = (http_path,) # X- allow for multiple URLs? ## Warning: check of validity of returned data relies on the XML namespace CQL_NAMESPACE of the returned XML markup. valid_root_element_tag = "{%s}explainResponse" % (CQL_namespace) ## Check status for all http_paths. results = \ map(lambda http_path : generic_tla_monitoring.check_condition(host = host, http_path = http_path, protocol = scheme, HTTP_method = 'GET', port_number = port_number, authorize = True, validator = generic_tla_monitoring.check_XML_validity, valid_root_element_tag = valid_root_element_tag, special_plugin_file_name = special_plugin_file_name), http_paths) generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description) if __name__ == "__main__" : generic_tla_monitoring.main(special_main_subroutine, command_line_parameters = command_line_parameters)