Skip to main content

Python module and script to invite people fetched from LDAP to Grafana

Project description

# grafana-inviter

[![image](https://dev.azure.com/tomtomweb/GitHub-TomTom-International/_apis/build/status/tomtom-international.grafana-inviter?branchName=master)](https://dev.azure.com/tomtomweb/GitHub-TomTom-International/_build/latest?definitionId=2&branchName=master)
[![image](https://img.shields.io/pypi/v/grafana-inviter.svg)](https://pypi-hypernode.com/project/grafana-inviter/)
[![image](https://img.shields.io/pypi/l/grafana-inviter.svg)](https://pypi-hypernode.com/project/grafana-inviter/)
[![image](https://img.shields.io/pypi/pyversions/grafana-inviter.svg)](https://pypi-hypernode.com/project/grafana-inviter/)

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.

## Installation

```bash
$ python setup.py install
```

## Usage

* 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

```bash
$ 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']
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grafana-inviter-0.0.1.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file grafana-inviter-0.0.1.tar.gz.

File metadata

  • Download URL: grafana-inviter-0.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for grafana-inviter-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b03ca958de62f7f7504da17b68771db5962f6b0db6de306cf444887c14c4258c
MD5 88aac9f141107beab6c51be721f5f82d
BLAKE2b-256 87192401577dc1236799be6be62c753114d4a04f932c9c81e5ccf88acc065f57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page