2023-10-17 18:25:00 +02:00
|
|
|
# Prometheus Jellyfin Exporter
|
|
|
|
|
|
|
|
This is an exporter that exposes information gathered from Jellyfin for use by the Prometheus monitoring system.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Requires Python 3.9 or better.
|
|
|
|
|
2023-10-22 14:54:23 +02:00
|
|
|
## Using docker
|
|
|
|
|
|
|
|
```
|
|
|
|
docker pull git.hipstercat.fr/hipstercat/jellyfin-exporter:main
|
|
|
|
```
|
|
|
|
|
|
|
|
Example: Display usage message:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker run -it --rm git.hipstercat.fr/hipstercat/jellyfin-exporter:main --help
|
|
|
|
```
|
|
|
|
|
|
|
|
Example: Run the image with a mounted configuration file and published port:
|
|
|
|
```
|
|
|
|
docker run --init --name prometheus-jellyfin-exporter -d -p 127.0.0.1:9222:9222 -v /path/to/pve.yml:/etc/pve.yml git.hipstercat.fr/hipstercat/jellyfin-exporter:main
|
|
|
|
```
|
|
|
|
Prometheus Jellyfin Exporter will now be reachable at http://localhost:9222/.
|
|
|
|
|
2023-10-17 18:25:00 +02:00
|
|
|
## Usage
|
|
|
|
|
2023-10-22 14:54:23 +02:00
|
|
|
Visit http://localhost:9222/jellyfin?target=1.2.3.4 where 1.2.3.4
|
2023-10-17 18:25:00 +02:00
|
|
|
is the IP of the Jellyfin server to get metrics from. Specify the `module`
|
|
|
|
request parameter, to choose which module to use from the config file.
|
|
|
|
|
|
|
|
The `target` request parameter defaults to `localhost`. Hence if
|
|
|
|
`jellyfin_exporter` is deployed directly on the jellyfin host, `target`
|
|
|
|
can be omitted.
|
|
|
|
|
|
|
|
## Authentication
|
|
|
|
|
|
|
|
**Using jellyfin.yml config file**
|
|
|
|
|
|
|
|
Example `jellyfin.yml` for token authentication:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
default:
|
|
|
|
api_key: "your token"
|
|
|
|
verify_ssl: true
|
|
|
|
```
|
|
|
|
|
|
|
|
## Prometheus Configuration
|
|
|
|
|
|
|
|
The Jellyfin exporter can be deployed either directly on a Jellyfin server or
|
|
|
|
onto a separate machine.
|
|
|
|
|
|
|
|
Example config for Jellyfin exporter running on Jellyfin server:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
scrape_configs:
|
|
|
|
- job_name: 'jellyfin'
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
2023-10-22 14:54:23 +02:00
|
|
|
- 192.168.1.2:9222 # Jellyfin server with Jellyfin exporter.
|
2023-10-17 19:12:36 +02:00
|
|
|
metrics_path: /jellyfin
|
2023-10-17 18:25:00 +02:00
|
|
|
params:
|
|
|
|
module: [default]
|
|
|
|
```
|
|
|
|
|
|
|
|
Example config for Jellyfin exporter running on Prometheus host:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
scrape_configs:
|
|
|
|
- job_name: 'jellyfin'
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
|
|
|
- 192.168.1.2 # Jellyfin server.
|
|
|
|
metrics_path: /jellyfin
|
|
|
|
params:
|
|
|
|
module: [default]
|
|
|
|
relabel_configs:
|
|
|
|
- source_labels: [__address__]
|
|
|
|
target_label: __param_target
|
|
|
|
- source_labels: [__param_target]
|
|
|
|
target_label: instance
|
|
|
|
- target_label: __address__
|
2023-10-22 14:54:23 +02:00
|
|
|
replacement: 127.0.0.1:9222 # Jellyfin exporter.
|
2023-10-17 18:25:00 +02:00
|
|
|
```
|