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

Last change on this file since 4047 was 4047, checked in by sanmai, 11 years ago
  • Make port_number specified as command line parameter. For simplicity, there is no

default value anymore, for now.

  • 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 = "Discojuice JSON"
8special_plugin_file_name = os.path.basename(__file__)
9command_line_parameters = [("-h", "host",),
10                           ("-u", "http_path",),
11                           ("-p", "port_number",)]
12
13
14def special_main_subroutine(host, 
15                            http_path,
16                            port_number) :
17
18    http_paths = (http_path,)
19   
20    ## Check status for all http_paths.
21    results = \
22        map(lambda http_path : generic_tla_monitoring.check_condition(host                      = host,
23                                                                      http_path                 = http_path,
24                                                                      HTTP_method               = "GET", 
25                                                                      port_number               = port_number,
26                                                                      authorize                 = True,
27                                                                      validator                 = generic_tla_monitoring.check_JSON_wellformedness,
28                                                                      special_plugin_file_name  = special_plugin_file_name),
29            http_paths)
30   
31
32    generic_tla_monitoring.nagios_return_complex(results, 
33                                                 reporter = special_plugin_description)
34
35if __name__ == "__main__" :
36    generic_tla_monitoring.main(special_main_subroutine, 
37                                command_line_parameters)
Note: See TracBrowser for help on using the repository browser.