diff options
-rw-r--r-- | README.md | 77 | ||||
-rw-r--r-- | contrib/init/linux-systemd/ejabberd-influxdb.service | 3 | ||||
-rw-r--r-- | ejabberd-metrics.yml.default | 7 |
3 files changed, 46 insertions, 41 deletions
@@ -19,46 +19,19 @@ apt install python-virtualenv # Arch pacman -S python-virtualenv -# mkdir venv -virtualenv -p python3 venv/ -r requirements.txt +# create a venv folder inside the cloned repository +mkdir venv +virtualenv -p python3 venv/ + +source ./venv/bin/activate +pip install -r requirements.txt ``` #### ejabberd -It is required to control a user account eligible to operate the tools with. We strongly recommend to use a dedicated -user to operate the api and to secure this account with a specifically strong password. +To operate the api it is required to provide a user account eligible to issue api commands. We strongly recommend to use +a dedicated user to operate the api and to secure this account with a specifically strong password. ### 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 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. @@ -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 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 Lookup table for all custom error codes. diff --git a/contrib/init/linux-systemd/ejabberd-influxdb.service b/contrib/init/linux-systemd/ejabberd-influxdb.service index 6b711b6..68490cb 100644 --- a/contrib/init/linux-systemd/ejabberd-influxdb.service +++ b/contrib/init/linux-systemd/ejabberd-influxdb.service @@ -1,8 +1,7 @@ [Unit] Description=ejabberd influxdb exporter Documentation=https://dev.sum7.eu/sum7/ejabberd-tools/-/blob/master/README.md -After=influxdb.service -Requires=ejabberd.service influxdb.service +Requires=ejabberd.service [Service] Type=simple diff --git a/ejabberd-metrics.yml.default b/ejabberd-metrics.yml.default index db1c89a..fc5dbf3 100644 --- a/ejabberd-metrics.yml.default +++ b/ejabberd-metrics.yml.default @@ -1,6 +1,6 @@ --- # endpoint url -url: "http://[::1]:5280/api" +url: "http://127.0.0.1:5280/api" # user credentials to the endpoint url login: @@ -15,8 +15,9 @@ muc_host: "chat" # api configuration # default : rpc api: "rest" -# show debugging log messages -debug: True + +# enable debug log messages +debug: false # influx db configuration influxdb_host: "localhost" |