Last change
on this file since 4057 was
4057,
checked in by sanmai, 11 years ago
|
- Make protocol/scheme (http, https) a command-line parameter and an internal
parameter. Fixes redirects from http URLs to https URLs and vice versa.
|
-
Property svn:executable set to
*
|
File size:
1.7 KB
|
Line | |
---|
1 | #!/usr/bin/python2 |
---|
2 | |
---|
3 | import generic_tla_monitoring |
---|
4 | import os, pdb |
---|
5 | |
---|
6 | |
---|
7 | special_plugin_description = "Discojuice HTML" |
---|
8 | special_plugin_file_name = os.path.basename(__file__) |
---|
9 | command_line_parameters = [("-s", "scheme"), |
---|
10 | ("-h", "host",), |
---|
11 | ("-u", "http_path",), |
---|
12 | ("-p", "port_number",)] |
---|
13 | |
---|
14 | |
---|
15 | def special_main_subroutine(scheme, |
---|
16 | host, |
---|
17 | http_path, |
---|
18 | port_number) : |
---|
19 | |
---|
20 | http_paths = (http_path,) |
---|
21 | |
---|
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 = port_number, |
---|
28 | authorize = True, |
---|
29 | validator = generic_tla_monitoring.check_HTML_wellformedness, |
---|
30 | special_plugin_file_name = special_plugin_file_name), |
---|
31 | http_paths) |
---|
32 | |
---|
33 | generic_tla_monitoring.nagios_return_complex(results, |
---|
34 | reporter = special_plugin_description) |
---|
35 | |
---|
36 | if __name__ == "__main__" : |
---|
37 | generic_tla_monitoring.main(special_main_subroutine, |
---|
38 | command_line_parameters) |
---|
Note: See
TracBrowser
for help on using the repository browser.