source: monitoring/plugins/mpi/check_clarin_ldap.py @ 3316

Last change on this file since 3316 was 3316, checked in by sanmai, 11 years ago
  • Fix command line argument processing and argument passing for check_clarin.ldap.py .
  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/usr/bin/env python
2# coding: utf-8
3"""
4    This Nagios monitoring plugin monitors availability of the CLARIN ERIC LDAP directory.
5   
6    Note: until a decent open source production-quality LDAP library for Python 3 becomes availble, this plugin relies on
7    the OpenDJ LDAP client command-line utilities.
8"""
9
10import generic_tla_monitoring
11import os, pdb
12
13
14special_plugin_description = "LDAP directory"
15special_plugin_file_name = os.path.basename(__file__)
16command_line_parameters = [("-h", "host",),
17                           ("-b", "bind DN",)]
18
19# Warning: check of validity of returned data relies on the XML namespace OAI_NAMESPACE of the returned XML markup.
20
21def special_main_subroutine(host,
22                            bind_DN) :
23
24    results = map(lambda host : generic_tla_monitoring.check_ldap(host = host, \
25                                                                  bind_DN = bind_DN, \
26                                                                  #special_plugin_file_name = special_plugin_file_name), \
27                                                                  (host,)
28                                                                  ) # X- allow for multiple hosts
29   
30    generic_tla_monitoring.nagios_return_complex(results, 
31                                                 reporter = special_plugin_description)
32
33if __name__ == "__main__" :
34    generic_tla_monitoring.main(special_main_subroutine = special_main_subroutine, 
35                                command_line_parameters = command_line_parameters)
Note: See TracBrowser for help on using the repository browser.