From b5d374c0ae58d7bff11b20b4714c4c6a3ef4cec0 Mon Sep 17 00:00:00 2001 From: genofire Date: Sun, 7 Nov 2021 18:31:48 +0100 Subject: [PATCH] improve docs for installing --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ config_example.toml | 3 +++ 2 files changed, 45 insertions(+) diff --git a/README.md b/README.md index 0f847a0..4ee7752 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,45 @@ An Prometheus Exporter for OvenMediaEngine (it provides also a small API-Client for OvenMediaEngine) Be welcome to improve it. + +## Configure OvenMediaEngine + +This Exporter use the REST-API of OvenMediaEngine, +to setting it up, that a look in there Documentation [OvenMediaEngine REST-API]( +https://airensoft.gitbook.io/ovenmediaengine/rest-api). + +## Setup Exporter + +### Compile + +Install [golang](https://golang.org/doc/install). + +Run: +`go install -v dev.sum7.eu/genofire/oven-exporter@latest` + +### Configuration +Read comments in [config_example.toml](config_example.toml) for more information. + +Maybe a good place to store this file is: `/etc/ovenmediaengine/exporter.conf` + +### Startup +Create a systemd.service file e.g. under `/etc/systemd/system/oven-exporter.service` with maybe a content like this: + +```ini +[Unit] +Description = Prometheus exporter for OvenMediaEngine + +[Service] +Type=simple +ExecStart=/usr/local/bin/oven-exporter -c /etc/ovenmediaengine/exporter.conf +Restart=always +RestartSec=5s +Environment=PATH=/usr/bin:/usr/local/bin + +[Install] +WantedBy=multi-user.target +``` +PS: maybe you need to adjust the binary path and configuration path. + +Start and enable on boot: +`systemctl enable --now oven-exporter.service` diff --git a/config_example.toml b/config_example.toml index 4bc9f5f..6671212 100644 --- a/config_example.toml +++ b/config_example.toml @@ -1,6 +1,9 @@ +# (Address +) Port where the Exporter is listen for Prometheus request listen = ":8080" [api] +# URL to REST-API of OvenMediaEngine url = "http://1.2.3.4:8081" +# AccessToken of OvenMediaEngine's REST-API token = "ome-access-token"