source: monitoring/plugins/mpi/check_clarin_discojuice_json.py @ 4059

Last change on this file since 4059 was 4059, checked in by sanmai, 11 years ago
  • Fix function calls in these plugins to also use the extra parameter 'scheme'.
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/usr/bin/python2
2
3import generic_tla_monitoring
4import os, pdb
5
6
7special_plugin_description = "Discojuice JSON"
8special_plugin_file_name = os.path.basename(__file__)
9command_line_parameters = [("-s", "scheme"), 
10                           ("-h", "host",),
11                           ("-u", "http_path",),
12                           ("-p", "port_number",)]
13
14def special_main_subroutine(scheme, 
15                            host, 
16                            http_path,
17                            port_number) : 
18
19    http_paths = (http_path,)
20   
21    ## Check status for all http_paths.
22    results = \
23        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
24                                                                      http_path                 = http_path, 
25                                                                      protocol                  = scheme, 
26                                                                      HTTP_method               = "GET", 
27                                                                      port_number               = port_number,
28                                                                      authorize                 = True,
29                                                                      validator                 = generic_tla_monitoring.check_JSON_wellformedness,
30                                                                      special_plugin_file_name  = special_plugin_file_name),
31            http_paths)
32   
33
34    generic_tla_monitoring.nagios_return_complex(results, 
35                                                 reporter = special_plugin_description)
36
37if __name__ == "__main__" :
38    generic_tla_monitoring.main(special_main_subroutine, 
39                                command_line_parameters)
Note: See TracBrowser for help on using the repository browser.