using this command
*./dsconf info -h localhost -p 389*
this shows the following
Instance path : /var/opt/SUNWdsee/dsins1
Global State : read-write
Host Name : amtest
LDAP Port : 389
SSL Port : 636
Total entries : 3908
Suffixes : dc=chile,dc=cl (master)
Dest. Servers : localhost:389
This is possible using the ldapsearch command, the first command asks me password.
with ldapsearch is possible? eg show me Total entries
Edited by: Rodrigo0461 on Nov 6, 2012 1:39 PM
you could use the password on command line also with the dsconf command, the only difference is that in the dsconf/dsadm commands the -w IS NOT referring to a 'password in clear' but to a 'password file'... so, if your password is admin123 then you could create your password file:
# echo admin123 > /path/to/your/protected/pwd.file
then, you could use the following command:
# ./dsconf info -h <HOST> -p <PORT> -D "cn=Directory Manager" -w /path/to/your/protected/pwd.file
the 'ldapsearch' equivalent, just to know which is the total number of the entries is:
# ldapsearch -b "<YOUR_SUFFIX>, cn=ldbm database, cn=plugins, cn=config" -D "cn=Directory Manager" -w password -p <PORT> -h <HOST> -1 -T cn=monitor ldapentrycount
Thanks again Marcos, I have other question.
this command ldapsearch -D "cn=Directory Manager" -w admin123 -h localhost -p 389 -1 -T -b "cn=clarochile,cn=ldbm database,cn=plugins,cn=config" cn=monitor entrycachehits
make the searched in the server with port 389
but, I can put two ports together with ldapsearch
You're welcome ;-)
No, unfortunately you cannot put a 'list of ports' in an ldapsearch command, you would need to 'script', maybe using a bash shell script like:
for MY_PORT in "389 1389 11389 12389 ... ";
ldapsearch -D "cn=Directory Manager" -w admin123 -h localhost -p $MY_PORT -1 -T -b "cn=clarochile,cn=ldbm database,cn=plugins,cn=config" cn=monitor entrycachehits
Please bear in mind that this is just an example, there are PLENTY of ways to improve it ;-)
Hehehe, I guessed that!!
P.S.: So could also this thread be considered "answered" ? ;-)
I'm still 'insisting' to mark the correct/helpful answers, so that when a user searches the forum he may quickly identify the solutions.
I echo Marco's comment, it is really a very nice script, and I am using "by default" on my all servers. However, you didn't put your name on that script, can I have your full name to associate your name with the script? Re: ns-slapd process is using 99% CPU.