FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Directory

 
 
LinkBack Thread Tools
 
Old 03-10-2009, 02:30 PM
David Boreham
 
Default Total number of LDAP entries

Rich Megginson wrote:
Assuming your entry cache contains every entry (that is, assuming you
have enough RAM to cache every entry), you can query the entry cache
count and that should be the number of entries in your directory
server. This is the (apparently) undocumented attribute called
currentEntryCacheCount in the cn=monitor entry for each database.
Hmm...this is a bit convoluted. You'd have to know the number of entries
in advance, then make sure the entry cache size was configured to a
larger number, then perform a search for all entries to force them into
the cache, and finally read the count. Wouldn't it be easier to just use
the search output to count the entries ? I suppose if you had a
gazillion entries, so many that it would take a very long time to send
them back to a client, then it might be worthwhile. You'd need to
concoct a search that you knew would touch every entry but would not
return any of them (a filter that is un-indexed and doesn't match any
entry would do it).





--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 02:55 PM
Nalin Dahyabhai
 
Default Total number of LDAP entries

On Tue, Mar 10, 2009 at 04:14:28PM +0100, Branimir wrote:
> well, I know that I can perform search and count them. I hoped that
> there is some shell command implemented in FDS that could provide this
> number. I administer commercial LDAP solution that provides such
> command. In my case this commercial solution charges per directory entry
> so I always have to know entry count. I was hoping FDC has some kind of
> equivalent command.

Assuming you only care about entries that get stored on disk (which is
what I'd prefer if I were a customer), you could find the id2entry
database file run 'db_stat -d' against it, and use the number of unique
keys and data items it returns as your count.

HTH,

Nalin

--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 02:57 PM
David Boreham
 
Default Total number of LDAP entries

Nalin Dahyabhai wrote:

Assuming you only care about entries that get stored on disk (which is
what I'd prefer if I were a customer), you could find the id2entry
database file run 'db_stat -d' against it, and use the number of unique
keys and data items it returns as your count.

This does essentially the same thing as a search for all entries.
However it will potentially give the wrong number because it'll include
deleted entries.



--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 04:35 PM
Branimir
 
Default Total number of LDAP entries

Rich Megginson wrote:

Branimir wrote:

David Boreham wrote:

Branimir wrote:
so there is no way to find the number of total LDAP entries stored
in FDC?
Obviously that's a ridiculous statement. You could at the very least
perform a search that

returns all entries and count them !

The server however does not maintain a running count itself. So one
way or another you will

need to count the entries.

Unless...you configure a VLV index covering the target entries (e.g.
all entries). This will
as a side-effect maintain the count, which can be retrieved with the
appropriate VLV search.


Hi David and Rocio,

David:
well, I know that I can perform search and count them. I hoped that
there is some shell command implemented in FDS that could provide this
number. I administer commercial LDAP solution

Which LDAP solution?

that provides such command.

What is the command and how does it work?


Hi Rich,

please don't be offended but I work in CA environment and I cannot
provide that information. What I can say that this command counts number
of entries on both master and replica servers.


Also thank you for the links.

Cheers,

Branimir

--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 04:38 PM
Branimir
 
Default Total number of LDAP entries

David Boreham wrote:

Branimir wrote:
well, I know that I can perform search and count them. I hoped that
there is some shell command implemented in FDS that could provide this
number. I administer commercial LDAP solution that provides such
command. In my case this commercial solution charges per directory
entry so I always have to know entry count. I was hoping FDC has some
kind of equivalent command.


Pipe the search output through grep and wc to count the entries returned.



Thanks David. I am familiar with UNIX basics . As I said before, I was
hoping there is some simple command for this, nothing more.


Cheers,

Branimir



--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 04:46 PM
Rich Megginson
 
Default Total number of LDAP entries

Branimir wrote:

Rich Megginson wrote:

Branimir wrote:

David Boreham wrote:

Branimir wrote:
so there is no way to find the number of total LDAP entries stored
in FDC?
Obviously that's a ridiculous statement. You could at the very
least perform a search that

returns all entries and count them !

The server however does not maintain a running count itself. So one
way or another you will

need to count the entries.

Unless...you configure a VLV index covering the target entries
(e.g. all entries). This will
as a side-effect maintain the count, which can be retrieved with
the appropriate VLV search.


Hi David and Rocio,

David:
well, I know that I can perform search and count them. I hoped that
there is some shell command implemented in FDS that could provide
this number. I administer commercial LDAP solution

Which LDAP solution?

that provides such command.

What is the command and how does it work?


Hi Rich,

please don't be offendedbut I work in CA environment and I cannot
provide that information.
Why? Is this the CA E-Trust Directory Server? If so, isn't the
information on it publicly available? If so, why would you not be able
to provide that information.
What I can say that this command counts number of entries on both
master and replica servers.
How does it work? Does it use LDAP? Does it invoke some sort of remote
shell?


Also thank you for the links.

Cheers,

Branimir

--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users


--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 04:53 PM
Branimir
 
Default Total number of LDAP entries

Rich Megginson wrote:

Branimir wrote:

Rich Megginson wrote:

Branimir wrote:

David Boreham wrote:

Branimir wrote:
so there is no way to find the number of total LDAP entries stored
in FDC?
Obviously that's a ridiculous statement. You could at the very
least perform a search that

returns all entries and count them !

The server however does not maintain a running count itself. So one
way or another you will

need to count the entries.

Unless...you configure a VLV index covering the target entries
(e.g. all entries). This will
as a side-effect maintain the count, which can be retrieved with
the appropriate VLV search.


Hi David and Rocio,

David:
well, I know that I can perform search and count them. I hoped that
there is some shell command implemented in FDS that could provide
this number. I administer commercial LDAP solution

Which LDAP solution?

that provides such command.

What is the command and how does it work?


Hi Rich,

please don't be offendedbut I work in CA environment and I cannot
provide that information.
Why? Is this the CA E-Trust Directory Server? If so, isn't the
information on it publicly available? If so, why would you not be able
to provide that information.


Sorry for misunderstanding. CA = Certificate Authority.

What I can say that this command counts number of entries on both
master and replica servers.
How does it work? Does it use LDAP? Does it invoke some sort of remote
shell?


It doesn't invoke remote shell and it doesn't use LDAP. That's all I can
say.


Branimir

--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 05:04 PM
"Ryan Braun [ADS]"
 
Default Total number of LDAP entries

On Tuesday 10 March 2009 17:38:33 Branimir wrote:
> David Boreham wrote:
> > Branimir wrote:
> >> well, I know that I can perform search and count them. I hoped that
> >> there is some shell command implemented in FDS that could provide this
> >> number. I administer commercial LDAP solution that provides such
> >> command. In my case this commercial solution charges per directory
> >> entry so I always have to know entry count. I was hoping FDC has some
> >> kind of equivalent command.
> >
> > Pipe the search output through grep and wc to count the entries returned.
>
> Thanks David. I am familiar with UNIX basics . As I said before, I was
> hoping there is some simple command for this, nothing more.
>
> Cheers,
>
> Branimir
>
Here's an easy perl script you can run, it will do a sub search on a given suffex and output the total entries returned.

Ryan


#!/usr/bin/perl

use strict;
use Net::LDAP;

my $bind_dn = "cn=directory manager";
my $bind_pw = "password";
my @servers = qw(server1.com server2.com);
my $base_dn = "cn=config";

foreach my $server (@servers) {

my $ldap = Net::LDAP->new($server, port => '389', timeout=>10);
if ( ! $ldap )
{

# return 0 here for a failed attempt
print "failed to connect to $server
";
return 0;
}
my $msg = $ldap->bind ( $bind_dn,password => $bind_pw ,version => 3 );

if ($msg->code) {
# print error message here because we have access to the $msg object
print " $server FAILURE " . $msg->code . " error text is " . $msg->error_name . "
";

return 0;
}

$msg = $ldap->search(filter=>"objectClass=*", base=>$base_dn,scope => 'sub' );

print "Found " . $msg->entries . " total entries in $base_dn on $server
";
}

--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 03-10-2009, 05:24 PM
Michael Ströder
 
Default Total number of LDAP entries

Ryan Braun [ADS] wrote:
> Here's an easy perl script you can run, it will do a sub search on a given suffex and output the total entries returned.

On FDS I'd prefer to search for (hasSubordinates=TRUE) and sum up the
values of the numSubordinates attribute in the entries found.

Other LDAP server implementations have other operational attributes with
different semantics:

Siemens DirX: numAllSubordinates

Critical Path Directory Server: countImmSubordinates, countTotSubordinates

MS Active Directory: msDS-Approx-Immed-Subordinates

My web2ldap uses all these besides 'hasSubordinates' to determine
whether an entry found is leaf entry or not and display the number of
subordinate entries in the link popup help.

Ciao, Michael.

--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 

Thread Tools




All times are GMT. The time now is 11:05 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org