LDAP Documentation Adjustment #2183

Closed
opened 2025-12-29 17:23:06 +01:00 by adam · 2 comments
Owner

Originally created by @Jemikwa on GitHub (Dec 8, 2018).

Change Type

[x] Addition
[ ] Correction
[ ] Deprecation
[ ] Cleanup (formatting, typos, etc.)

Proposed Changes

  1. Either appending or changing the "Install django-auth-ldap" section to specify "pip3" for the command. This had me scratching my head for the past few days because I ran pip install django-auth-ldap and ldap was not running when netbox was restarted at the end of the instructions. Using pip3 instead installed the correct module, and ldap finally began working once this was done.

  2. Adding a quip for "you can run supervisorctl restart netbox to test your ldap config" to clarify how to troubleshoot would be appreciated.

  3. The following code would be very useful for users to include if they are troubleshooting ldap (configuring logging to /opt/netbox/logs)

import logging, logging.handlers
logfile = "/opt/netbox/logs/django-ldap-debug.log"
my_logger = logging.getLogger('django_auth_ldap')
my_logger.setLevel(logging.DEBUG)
handler = logging.handlers.RotatingFileHandler(
   logfile, maxBytes=1024 * 500, backupCount=5)
my_logger.addHandler(handler)
Originally created by @Jemikwa on GitHub (Dec 8, 2018). <!-- Please indicate the nature of the change by placing an X in one of the boxes below. --> ### Change Type [x] Addition [ ] Correction [ ] Deprecation [ ] Cleanup (formatting, typos, etc.) <!-- Describe the proposed change(s). --> ### Proposed Changes 1. Either appending or changing the "Install django-auth-ldap" section to specify "pip3" for the command. This had me scratching my head for the past few days because I ran `pip install django-auth-ldap` and ldap was not running when netbox was restarted at the end of the instructions. Using pip3 instead installed the correct module, and ldap finally began working once this was done. 2. Adding a quip for "you can run `supervisorctl restart netbox` to test your ldap config" to clarify how to troubleshoot would be appreciated. 3. The following code would be very useful for users to include if they are troubleshooting ldap (configuring logging to /opt/netbox/logs) ``` import logging, logging.handlers logfile = "/opt/netbox/logs/django-ldap-debug.log" my_logger = logging.getLogger('django_auth_ldap') my_logger.setLevel(logging.DEBUG) handler = logging.handlers.RotatingFileHandler( logfile, maxBytes=1024 * 500, backupCount=5) my_logger.addHandler(handler) ```
adam added the status: acceptedtype: documentation labels 2025-12-29 17:23:06 +01:00
adam closed this issue 2025-12-29 17:23:06 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 10, 2018):

I've updated the pip command in the document since it should have been included during the v2.5 review. I'll leave this open if you want to submit a PR for the rest.

@jeremystretch commented on GitHub (Dec 10, 2018): I've updated the `pip` command in the document since it should have been included during the v2.5 review. I'll leave this open if you want to submit a PR for the rest.
Author
Owner

@till commented on GitHub (Feb 4, 2019):

I am trying to use this code snippet above to troubleshoot why LDAP isn't working for us. But all I get is: Caught LDAPError while authenticating my.user: LDAPError(0, 'Error') (my.user = my actual login).

Is there a way to amp up the logging?

@till commented on GitHub (Feb 4, 2019): I am trying to use this code snippet above to troubleshoot why LDAP _isn't working_ for us. But all I get is: `Caught LDAPError while authenticating my.user: LDAPError(0, 'Error')` (`my.user` = my actual login). Is there a way to amp up the logging?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2183