diff options
author | Niko Tyni <ntyni@iki.fi> | 2005-10-28 13:19:29 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2005-10-28 13:19:29 +0200 |
commit | 86525919fb7ff3e1cd8c1f3ab6bfb5f8c095468e (patch) | |
tree | d71e9390d33a945b2cca8deb1bb9f9063fd841c6 /lib | |
parent | 5f5bd15d7cbd95b1ba4507dbe79c32628b3a6a80 (diff) | |
download | smokeping-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')
-rw-r--r-- | lib/Smokeping/probes/LDAP.pm | 10 |
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; |