From 86525919fb7ff3e1cd8c1f3ab6bfb5f8c095468e Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Fri, 28 Oct 2005 11:19:29 +0000 Subject: * (trunk,2.0)/ lib/Smokeping/probes/LDAP.pm, CHANGES: + add the 'scope' Net::LDAP search option to the LDAP probe --- lib/Smokeping/probes/LDAP.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/Smokeping/probes/LDAP.pm') diff --git a/lib/Smokeping/probes/LDAP.pm b/lib/Smokeping/probes/LDAP.pm index 2888a14..61d2957 100644 --- a/lib/Smokeping/probes/LDAP.pm +++ b/lib/Smokeping/probes/LDAP.pm @@ -145,6 +145,12 @@ sub targetvars { s.", _re => '(\d*\.)?\d+', }, + scope => { + _doc => "The scope of the query. Can be either 'base', 'one' or 'sub'. See the Net::LDAP documentation for details.", + _example => "one", + _re => "(base|one|sub)", + _default => "sub", + }, }); } @@ -171,6 +177,8 @@ sub pingone { my $timeout = $vars->{timeout}; + my $scope = $vars->{scope}; + my $password; if (defined $binddn) { $password = $self->password($host, $binddn); @@ -203,7 +211,7 @@ sub pingone { } local $IO::Socket::SSL::SSL_Context_obj; # ugly but necessary $start = gettimeofday(); - my $ldap = new Net::LDAP($host, port => $port, version => $version, timeout => $timeout) + my $ldap = new Net::LDAP($host, port => $port, version => $version, timeout => $timeout, scope => $scope) or do { $self->do_log("connection error on $host: $!"); next; -- cgit v1.2.3-24-g4f1b