#!/usr/bin/env python # coding: utf-8 """ This Nagios monitoring plugin monitors availability of the CLARIN ERIC LDAP directory. Note: until a decent open source production-quality LDAP library for Python 3 becomes availble, this plugin relies on the OpenDJ LDAP client command-line utilities. """ import generic_tla_monitoring import os, pdb special_plugin_description = "LDAP directory" special_plugin_file_name = os.path.basename(__file__) command_line_parameters = [("-h", "host",), ("-b", "bind DN",)] # Warning: check of validity of returned data relies on the XML namespace OAI_NAMESPACE of the returned XML markup. def special_main_subroutine(host, bind_DN) : results = map(lambda host : generic_tla_monitoring.check_ldap(host = host, bind_DN = bind_DN), #special_plugin_file_name = special_plugin_file_name), \ (host,)) generic_tla_monitoring.nagios_return_complex(results, reporter = special_plugin_description) if __name__ == "__main__" : generic_tla_monitoring.main(special_main_subroutine = special_main_subroutine, command_line_parameters = command_line_parameters)