clarify documentation
* align url parameter to the ejabberd example * update virtualenv command * remove influxdb service requirement from service template
This commit is contained in:
parent
4f53572c7e
commit
ede665016b
77
README.md
77
README.md
|
@ -19,46 +19,19 @@ apt install python-virtualenv
|
||||||
# Arch
|
# Arch
|
||||||
pacman -S python-virtualenv
|
pacman -S python-virtualenv
|
||||||
|
|
||||||
# mkdir venv
|
# create a venv folder inside the cloned repository
|
||||||
virtualenv -p python3 venv/ -r requirements.txt
|
mkdir venv
|
||||||
|
virtualenv -p python3 venv/
|
||||||
|
|
||||||
|
source ./venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
#### ejabberd
|
#### ejabberd
|
||||||
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 it is required to provide a user account eligible to issue api commands. We strongly recommend to use
|
||||||
user to operate the api and to secure this account with a specifically strong password.
|
a dedicated user to operate the api and to secure this account with a specifically strong password.
|
||||||
|
|
||||||
### configuration
|
### configuration
|
||||||
#### 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
|
#### 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.
|
||||||
|
@ -102,7 +75,39 @@ api_permissions:
|
||||||
The `ejabberd-metrics.yml` file is the central configuration file which is used by all current and future tools inside
|
The `ejabberd-metrics.yml` file is the central configuration file which is used by all current and future tools inside
|
||||||
this repository.
|
this repository.
|
||||||
|
|
||||||
We provide a `ejabberd-metrics.yml.default` file which lists and explains which parameters should be set.
|
We provide an `ejabberd-metrics.yml.default` file, listing all possible and potentially necessary parameters. The final
|
||||||
|
configuration file should be located at `/etc/ejabberd-metrics.yml`.
|
||||||
|
|
||||||
|
#### systemd service
|
||||||
|
To properly operate the metrics exporter tools, we created some systemd service 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` parameter to include the virtualenv Python intepreter.
|
||||||
|
|
||||||
### error codes
|
### error codes
|
||||||
Lookup table for all custom error codes.
|
Lookup table for all custom error codes.
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ejabberd influxdb exporter
|
Description=ejabberd influxdb exporter
|
||||||
Documentation=https://dev.sum7.eu/sum7/ejabberd-tools/-/blob/master/README.md
|
Documentation=https://dev.sum7.eu/sum7/ejabberd-tools/-/blob/master/README.md
|
||||||
After=influxdb.service
|
Requires=ejabberd.service
|
||||||
Requires=ejabberd.service influxdb.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
# endpoint url
|
# endpoint url
|
||||||
url: "http://[::1]:5280/api"
|
url: "http://127.0.0.1:5280/api"
|
||||||
|
|
||||||
# user credentials to the endpoint url
|
# user credentials to the endpoint url
|
||||||
login:
|
login:
|
||||||
|
|
Loading…
Reference in New Issue