Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Cacti to use multiple possible LDAP servers #4299

Closed
bmfmancini opened this issue Jun 10, 2021 · 18 comments
Closed

Allow Cacti to use multiple possible LDAP servers #4299

bmfmancini opened this issue Jun 10, 2021 · 18 comments
Assignees
Labels
enhancement General tag for an enhancement resolved A fixed issue
Milestone

Comments

@bmfmancini
Copy link
Member

Hey Guys,

In the current cacti LDAP settings you are only able to provide a single LDAP server
It would be good to be able to add a secondary server
Thanks !

@bmfmancini bmfmancini added the enhancement General tag for an enhancement label Jun 10, 2021
@netniV
Copy link
Member

netniV commented Jun 11, 2021

Actually, if you use LDAP domains section, you can have multiple LDAP authentication. One of the updates to 1.3 will be to remove the older single LDAP configuration.

@netniV
Copy link
Member

netniV commented Jun 11, 2021

Oh, do you mean a backup LDAP server?

@bmfmancini
Copy link
Member Author

bmfmancini commented Jun 11, 2021 via email

@netniV netniV added this to the v1.3.0 milestone Jun 11, 2021
@netniV netniV self-assigned this Jun 11, 2021
@bmfmancini bmfmancini changed the title [Feature request] - Add option to specify an alternate LDAP server [Feature request] - Add option to specify a backup LDAP server Jun 11, 2021
@netniV
Copy link
Member

netniV commented Jun 12, 2021

OK, so first thing to define, which of these known errors should failover to the backup:

     const None                  = 0;
     const Success               = 0;
     const Failure               = 1;
     const UndefinedUsername     = 2;
     const ProtocolErrorVersion  = 3;
     const ProtocolErrorReferral = 4;
     const ProtocolErrorTls      = 5;
     const MissingLdapObject     = 6;
     const ProtocolErrorGeneral  = 7;
     const InsufficientAccess    = 8;
     const ConnectionUnavailable = 9;
     const ConnectionTimeout     = 10;
     const ProtocolErrorBind     = 11;
     const SearchFoundNoGroup    = 12;
     const SearchFoundMultiUser  = 13;
     const SearchFoundNoUser     = 14;
     const SearchFoundNoUserDN   = 15;
     const UndefinedDnOrPassword = 16;
     const Disabled              = 99;

@netniV
Copy link
Member

netniV commented Jun 12, 2021

Work is underway to simplify LDAP setitngs by removing from global and just using the user domains.

develop...ldap

Feel free to run in a test lab, but the upgrade process isn't right yet if you were already using LDAP (not multiple ldap), I just wanted to commit it so you can see what has been going on.

@TheWitness
Copy link
Member

Not using a VIP or RRDNS with VIPs?

@bmfmancini
Copy link
Member Author

bmfmancini commented Jun 25, 2021 via email

@netniV
Copy link
Member

netniV commented Jun 28, 2021

So, we are still at the point of deciding which of the above errors can cause a failover to the secondary server. And I presume the secondary must have all the same settings aside from hostname?

@bmfmancini
Copy link
Member Author

bmfmancini commented Jun 28, 2021 via email

@arno-st
Copy link
Contributor

arno-st commented Oct 18, 2021

If I may add some input, I'm using multiple LDAP config, and for me this 2 should s handled:
const ConnectionUnavailable = 9;
const ConnectionTimeout = 10;
const ProtocolErrorBind = 11;

The other are LDAP data error, not kind of protocol releated error. So if you have a replication of the 2 LDAP servers, the other errors are most likelly to be the same.
Event the error about the version, should give you other error on your domain, and is not suppose to be different on master and backup server.

Just my point to the reflection!

@bmfmancini
Copy link
Member Author

bmfmancini commented Oct 18, 2021 via email

@TheWitness
Copy link
Member

TheWitness commented Oct 18, 2021

The way that I would implement this is to explode the hostname based upon a space or other character and then based upon the response use the second hosts to test. Of course, it might be better served by a VIP, but we can implement two settings for those that lack the IT skills to deploy LDAP using a Linux Cluster or a cluster of Linux Clusters.

@arno-st
Copy link
Contributor

arno-st commented Oct 18, 2021

Don't you think if you have a VIP, you dont really have a 'second' host.
Since both will be behind the VIP config !
So testing the second server with part of the hostname/domain extracted from the query, then you also should check the main server with this same query.
In my understanding your not looking about a backup server, but more like a load sharing issue.
Maybee I misinterpret you vision?

And sometime it's not a question of lack of knowledge of Linux clustering, but Datacenter design. (using windows AD, or not in cluster config, but different server with synchronisation)

@TheWitness TheWitness changed the title [Feature request] - Add option to specify a backup LDAP server Allow Cacti to use multiple possible LDAP servers Oct 19, 2021
@TheWitness TheWitness modified the milestones: v1.3.0, v1.2.19 Oct 19, 2021
@TheWitness
Copy link
Member

The fix is really simple.

TheWitness added a commit that referenced this issue Oct 19, 2021
Allow Cacti to use multiple possible LDAP servers
@TheWitness TheWitness added the resolved A fixed issue label Oct 19, 2021
@TheWitness
Copy link
Member

Moved this to 1.2.19 as it's such a simple fix. Please test.

TheWitness added a commit that referenced this issue Oct 22, 2021
I don't like the solution, but it works now.
@TheWitness
Copy link
Member

After testing, it was not as simple as I thought. However, I've worked through the various in's and out's of the library, and though I don't completely like the solution, it's workable for this release.

@TheWitness
Copy link
Member

@bmfmancini test in the morning. No need for a zoom. If it's workable for you, just close this.

@TheWitness
Copy link
Member

Found that our LDAP setup uses default timeouts. Addressing that today.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement General tag for an enhancement resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants