summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping/probes/LDAP.pm
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2005-10-28 13:19:29 +0200
committerNiko Tyni <ntyni@iki.fi>2005-10-28 13:19:29 +0200
commit86525919fb7ff3e1cd8c1f3ab6bfb5f8c095468e (patch)
treed71e9390d33a945b2cca8deb1bb9f9063fd841c6 /lib/Smokeping/probes/LDAP.pm
parent5f5bd15d7cbd95b1ba4507dbe79c32628b3a6a80 (diff)
downloadsmokeping-86525919fb7ff3e1cd8c1f3ab6bfb5f8c095468e.tar.gz
smokeping-86525919fb7ff3e1cd8c1f3ab6bfb5f8c095468e.tar.xz
* (trunk,2.0)/
lib/Smokeping/probes/LDAP.pm, CHANGES: + add the 'scope' Net::LDAP search option to the LDAP probe
Diffstat (limited to 'lib/Smokeping/probes/LDAP.pm')
-rw-r--r--lib/Smokeping/probes/LDAP.pm10
1 files changed, 9 insertions, 1 deletions
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;