Skip to content

minodudd/check_ldap_request

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

check_ldap_request

Nagios Plugin - Check if LDAP attribute exist

Installation

  • Simply put the nagios plugin check_ldap_request.pl in your nagios-plugins directory
  • Install the perl module using cpan (install Net::LDAP)

Nagios configuration

define command{
command_name check_ldap_request
command_line $USER2$/check_ldap_request.pl -H $HOSTADDRESS$ -b "dc=ldap,dc=company,dc=lan" -f "uid=pmavro"
}

define service{
use generic-services
hostgroup_name ldapsrv
service_description LDAP request check
check_command check_ldap_request
}

Usage

Usage : ./check_ldap -H hostname -b base -f filer [-s scope] [-h]
-H : LDAP server hostname or IP
-b : Base of LDAP server (ex: "dc=ldap,dc=company,dc=lan")
-f : Specify a filter (ex: "uid=pmavro")
-s : LDAP Scope (ex: sub)
-h : Print this help message

Examples

$ ./check_ldap_request.pl -H prd-ldap-srv -b "dc=openldap,dc=mycompany,dc=com" -f "uid=pmavro"
LDAP request OK - 'uid=pmavro' exists

$ ./check_ldap_request.pl -H prd-ldap-srv -b "dc=openldap,dc=mycompany,dc=com" -f "cn=foo"
LDAP request CRITICAL - unable to find 'cn=foo'

About

Nagios Plugin - Check if LDAP attribute exist

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Perl 100.0%