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 | |
---|
10 | import generic_tla_monitoring |
---|
11 | import os, pdb |
---|
12 | |
---|
13 | |
---|
14 | special_plugin_description = "LDAP directory" |
---|
15 | special_plugin_file_name = os.path.basename(__file__) |
---|
16 | command_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 | |
---|
21 | def 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 | |
---|
33 | if __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.