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 | |
---|
3 | import generic_tla_monitoring |
---|
4 | import os, pdb |
---|
5 | |
---|
6 | |
---|
7 | special_plugin_description = "CQL endpoint" |
---|
8 | special_plugin_file_name = os.path.basename(__file__) |
---|
9 | CQL_NAMESPACE = "http://www.loc.gov/zing/srw/" |
---|
10 | command_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 | |
---|
15 | def 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 | |
---|
34 | if __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.