source: monitoring/plugins/mpi/check_lat_postgresql.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.7 KB
Line 
1#!/usr/bin/python2
2
3import generic_tla_monitoring
4import os, pdb
5
6#http://lux08.mpi.nl:8984/rest/
7special_plugin_description = "LAT PostgreSQL database server"
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                 = False,
27                                                                      validator                 = generic_tla_monitoring.check_HTML_wellformedness,
28                                                                      special_plugin_file_name  = special_plugin_file_name),
29                  http_paths)   
30   
31    generic_tla_monitoring.nagios_return_complex(results, 
32                                                 reporter = special_plugin_description)
33
34if __name__ == "__main__" :
35    generic_tla_monitoring.main(special_main_subroutine, 
36                                command_line_parameters)
Note: See TracBrowser for help on using the repository browser.