further documentation
+ add systemd service documentation
This commit is contained in:
parent
331adaf820
commit
893f68497d
45
README.md
45
README.md
|
@ -3,12 +3,12 @@ Repository containing various ejabberd tools.
|
||||||
|
|
||||||
### tools
|
### tools
|
||||||
#### metrics
|
#### metrics
|
||||||
The metrics class is a tool to gather and aggregate metrics data through the ejabberd rest/ xmlrpc interface.
|
The metrics class is a tool to gather and aggregate metrics data through the ejabberd rest/ xmlrpc interface. In
|
||||||
In addition to that [Prometheus](https://prometheus.io/) and [InfluxDB](https://www.influxdata.com/) client
|
addition to that a [Prometheus](https://prometheus.io/) and [InfluxDB](https://www.influxdata.com/) client utilizing the
|
||||||
utilizing the metrics class.
|
metrics class is provided.
|
||||||
|
|
||||||
### requirements
|
### requirements
|
||||||
The easiest way to setup a clean Python project environment is, to use a virtual environment inside the cloned
|
The easiest way to setup a clean Python project environment is to use a virtual environment inside the cloned
|
||||||
repository directory. The following bash lines install the `python-virtualenv` module, create the virtual environment
|
repository directory. The following bash lines install the `python-virtualenv` module, create the virtual environment
|
||||||
using Python3 and finally install all dependencies listed in the requirements file.
|
using Python3 and finally install all dependencies listed in the requirements file.
|
||||||
|
|
||||||
|
@ -24,11 +24,42 @@ virtualenv -p python3 venv/ -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
#### ejabberd
|
#### ejabberd
|
||||||
It is required to have/ create a user account to operate the tools with. We strongly recommend to use a dedicated user
|
It is required to control a user account eligible to operate the tools with. We strongly recommend to use a dedicated
|
||||||
to operate the api and to secure the account with a strong password.
|
user to operate the api and to secure this account with a specifically strong password.
|
||||||
|
|
||||||
### configuration
|
### configuration
|
||||||
#### api permissions
|
#### systemd service
|
||||||
|
To properly operate the metrics exporter tools, we created some systemd templates, to simplify the whole process.
|
||||||
|
If the `ejabberd-metrics.yml` file is not accessible for the user`nobody:nogroup`, it is required to update the `User`
|
||||||
|
and `Group` definitions inside the service file.
|
||||||
|
If a virtualenv is used, it is required to update the `Environment=PATH` to include the `venv/bin` directory created
|
||||||
|
earlier.
|
||||||
|
|
||||||
|
```systemd
|
||||||
|
[Unit]
|
||||||
|
Description=ejabberd influxdb exporter
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
|
||||||
|
# this strongly depends on the ejabberd-metrics.yml permissions
|
||||||
|
User=nobody
|
||||||
|
Group=nogroup
|
||||||
|
|
||||||
|
ExecStart=/opt/ejabberd-metrics/influx.py
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5s
|
||||||
|
|
||||||
|
# if the virtualenv is used PATH needs to customized
|
||||||
|
Environment=PATH=/opt/ejabberd-metrics/venv/bin:/usr/bin:/usr/local/bin
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
Another possible solution would be to edit the `ExecStart` paramter to include the virtualenv Python intepreter.
|
||||||
|
|
||||||
|
#### ejabberd: api permissions
|
||||||
These configurations options first add the `mod_http_api` listener. Additionally the user `api_user@magicbroccoli.de` is
|
These configurations options first add the `mod_http_api` listener. Additionally the user `api_user@magicbroccoli.de` is
|
||||||
added to the `acl` group, thus enabling him to access the `mod_http_api` configured in the `api_permissions` block.
|
added to the `acl` group, thus enabling him to access the `mod_http_api` configured in the `api_permissions` block.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ejabberd2influxdb
|
Description=ejabberd influxdb exporter
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
Loading…
Reference in New Issue