source: monitoring/plugins/mpi/check_lat_cql_endpoint.py @ 3270

Last change on this file since 3270 was 3270, checked in by sanmai, 11 years ago
  • Adapt monitoring plugins to new command line argument processing.
  • Fix MPI monitoring checks table so that every check is on a separate line.
  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/usr/bin/python2
2
3import generic_tla_monitoring
4import os, pdb
5
6
7special_plugin_description = "CQL endpoint"
8special_plugin_file_name = os.path.basename(__file__)
9CQL_NAMESPACE = "http://www.loc.gov/zing/srw/"
10command_line_parameters = [("-h", "host",),
11                           ("-u", "URL",)]
12
13# Warning: check of validity of returned data relies on the XML namespace CQL_NAMESPACE of the returned XML markup.
14
15def special_main_subroutine(host,
16                            URL) :
17   
18    UP_URLs = (URL,) # X- allow for multiple URLs?
19
20    valid_root_element_tag = "{%s}explainResponse" % (CQL_NAMESPACE)
21   
22    # Check status for all UP_URLs.
23    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)
31   
32    generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description)
33
34if __name__ == "__main__" :
35    generic_tla_monitoring.main(special_main_subroutine,
36                                command_line_parameters = command_line_parameters)
Note: See TracBrowser for help on using the repository browser.