Was testing the solution on the wrong box. :(
Ax that. At any rate, I have the same problem on my Solaris 10 machine. I'll run some tests and see if I come up with anything.
LDAP
Moderators: Developers, Moderators
After I had set the LDAP values in Cacti and tried to login to Cacti I received the error message:
LDAP Error: Unable to create LDAP object
I then hit the command line and tried to perform the search using the same values that I had set in Cacti.
# ldapsearch uid=<username>,ou=people,o=domain,o=tld
I then received the following error from the command line.
ldap_search: Can't connect to the LDAP server - Connection refused
Initially, I thought I had a setting wrong because they seem to be fairly similar error messages. After a couple hours of banging my head against the wall I asked someone to try it from their machine and it worked for them. It turns out that when I tested the settings from the command line I missed the -h option on the command line.
# ldapsearch -h <fqdn for ldap server> uid=<username>,ou=people,o=domain,o=tld
After accidentally forgetting the -h option on the command line made me think that Cacti is not properly setting the host value.
So then I hit the forums searching for a solution to the problem and that is when I came across these posts.
Used for manually setting values in lib/ldap.php
http://forums.cacti.net/viewtopic.php?t=25916
Used to account for special characters
http://forums.cacti.net/viewtopic.php?t=25820
After I made these changes everything worked successfully.
So now I found that if you comment out the following code in lib/ldap.php it works as well.
112 /*
113 }else{
114 $ldap_host = "ldap://" . $ldap_host;
115 }
116 */
The above code is in more than one place in the file. You may or may not need to comment the additional sections out depending on what type of LDAP searching you are using.
Hope this helps.
LDAP Error: Unable to create LDAP object
I then hit the command line and tried to perform the search using the same values that I had set in Cacti.
# ldapsearch uid=<username>,ou=people,o=domain,o=tld
I then received the following error from the command line.
ldap_search: Can't connect to the LDAP server - Connection refused
Initially, I thought I had a setting wrong because they seem to be fairly similar error messages. After a couple hours of banging my head against the wall I asked someone to try it from their machine and it worked for them. It turns out that when I tested the settings from the command line I missed the -h option on the command line.
# ldapsearch -h <fqdn for ldap server> uid=<username>,ou=people,o=domain,o=tld
After accidentally forgetting the -h option on the command line made me think that Cacti is not properly setting the host value.
So then I hit the forums searching for a solution to the problem and that is when I came across these posts.
Used for manually setting values in lib/ldap.php
http://forums.cacti.net/viewtopic.php?t=25916
Used to account for special characters
http://forums.cacti.net/viewtopic.php?t=25820
After I made these changes everything worked successfully.
So now I found that if you comment out the following code in lib/ldap.php it works as well.
112 /*
113 }else{
114 $ldap_host = "ldap://" . $ldap_host;
115 }
116 */
The above code is in more than one place in the file. You may or may not need to comment the additional sections out depending on what type of LDAP searching you are using.
Hope this helps.
I was having the same issue after upgrading from an 8.6 database to 8.7. The host field was auto populated with "ldap://10.1.50.2" (which is correct in 8.6).
Following the code snipets above doing some of my own testing, if you leave that as is, the string passed to the "ldap_conn" creation is "ldap://ldap://10.1.50.2" which is of course incorrect.
I just removed the "ldap://" from my field and it works fine now.
In short: try using JUST the host name, no URI in the "Server" field in Cacti.
Following the code snipets above doing some of my own testing, if you leave that as is, the string passed to the "ldap_conn" creation is "ldap://ldap://10.1.50.2" which is of course incorrect.
I just removed the "ldap://" from my field and it works fine now.
In short: try using JUST the host name, no URI in the "Server" field in Cacti.
-
- Posts: 9
- Joined: Wed Sep 06, 2006 1:50 am
I'm getting this same error ...
LDAP Search Error: Unable to create LDAP connection object
I happen to be running CentOS directory server, not openldap ... though I can't imagine why it'd make much of a difference.
Running CentOS 5.2, php-5.2.6-2.el5s2.
Running Cacti Version 0.8.7b
I *know* my LDAP bind and anon search are working properly because i've got all my Apache auth using LDAP for lookups.
So here are my values :
Server = 10.x.x.x
Port Standard = 389
Port SSL = blank
Protocol version = 3
Encryption = none
Referrals = disabled
Mode = Tried anon, specific, and no searching
DN= uid=<username>,ou=People,dc=my-domain,dc=com
Search base = ou=People,dc=my-domain,dc=com
Search Filter = blank
Search DN = uid=binduser,ou=people,dc=my-domain,dc=com
Password = whatever
Nothing's really logging any errors anywhere that I can see. At least certainly not in apache logs, php.ini set error logs, etc. Everything's an rpm install ... php, openldap, openldap-devel, php-ldap.
Thoughts?
LDAP Search Error: Unable to create LDAP connection object
I happen to be running CentOS directory server, not openldap ... though I can't imagine why it'd make much of a difference.
Running CentOS 5.2, php-5.2.6-2.el5s2.
Running Cacti Version 0.8.7b
I *know* my LDAP bind and anon search are working properly because i've got all my Apache auth using LDAP for lookups.
So here are my values :
Server = 10.x.x.x
Port Standard = 389
Port SSL = blank
Protocol version = 3
Encryption = none
Referrals = disabled
Mode = Tried anon, specific, and no searching
DN= uid=<username>,ou=People,dc=my-domain,dc=com
Search base = ou=People,dc=my-domain,dc=com
Search Filter = blank
Search DN = uid=binduser,ou=people,dc=my-domain,dc=com
Password = whatever
Nothing's really logging any errors anywhere that I can see. At least certainly not in apache logs, php.ini set error logs, etc. Everything's an rpm install ... php, openldap, openldap-devel, php-ldap.
Thoughts?
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Please open a bug http://www.cacti.net/bugs.phpxloob wrote:I was having the same issue after upgrading from an 8.6 database to 8.7. The host field was auto populated with "ldap://10.1.50.2" (which is correct in 8.6).
Following the code snipets above doing some of my own testing, if you leave that as is, the string passed to the "ldap_conn" creation is "ldap://ldap://10.1.50.2" which is of course incorrect.
I just removed the "ldap://" from my field and it works fine now.
In short: try using JUST the host name, no URI in the "Server" field in Cacti.
Reinhard
Who is online
Users browsing this forum: No registered users and 3 guests