Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Script and module to send Grafana invites to users obtained from LDAP

License

Notifications You must be signed in to change notification settings

tomtom-international/grafana-inviter

grafana-inviter

Azure DevOps builds Azure DevOps tests Azure DevOps coverage

PyPI - Version PyPI - License PyPI - Python Versions PyPI - Format PyPI - Status PyUp - Updates

Inviting people to join a Grafana organization is usually done from the Grafana UI. For smaller groups this might be easy but for a larger set of people one rather would like to not fiddle around in the UI and instead do it in an automated fashion.

This tool is intended to send invites to join a new Grafana organization to people obtained from LDAP.

Features

  • Fetch users from LDAP and generate Grafana invites links
  • Send invite links to users

Quickstart

pip install grafana-inviter
  • Copy the example_config.json configuration and adjust it to your needs
  • Generate a Grafana API token with admin privileges (https://<YOUR_GRAFANA_URL>/org/apikeys)
  • Ensure you have a LDAP service account user for searches created
grafana-inviter --grafana-token "<YOUR_GF_TOKEN_WITH>" --ldap-user <YOUR_SVC_ACCOUNT_USER> --config config.json --ask-ldap-password
LDAP password:
Sending invite to John Doe (John Doe@acme.org)
{'name': 'John Doe', 'loginOrEmail': 'John.Doe@acme.org', 'role': 'Viewer', 'sendEmail': False, 'orgId': 10}
 > User John.Doe@acme.org is already added to organization
Sending invite to Jane Doe (Jane.Doe@acme.org)
{'name': 'Jane Doe', 'loginOrEmail': 'Jane.Doe@acme.org', 'role': 'Viewer', 'sendEmail': False, 'orgId': 10}
 > Created invite for Jane.Doe@acme.org

Available invite URLs: ['https://<YOUR_GRAFANA_URL>/invite/Vv4Q8SYVyk7ULGpeWvjMXl0iuWLl67']

Credits

This package was created with Cookiecutter and the tomtom-international/cookiecutter-python project template.

About

Script and module to send Grafana invites to users obtained from LDAP

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •