lucas-dclrcq / nzbget-exporter

NZBGet Prometheus metrics exporter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NZBGet Exporter

Build Status Git Commit Layers Latest Version

A Prometheus-style exporter for NZBGet metrics and statistics via the NZBGet API. It does what it says on the tin!

Important notice

NZBGet has an unsigned integer bug that causes this exporter to return 500 errors. It has been fixed in NZBGet v21.1 and newer. It is adviseable to use the latest version of NZBGet with this exporter, otherwise you may experience large periods of time with no metrics.

Getting Started

Build from source

git clone https://github.com/frebib/nzbget-exporter.git .
go install github.com/niktri/enumerx@latest
go generate
go build -o nzbget_exporter
./nzbget_exporter --help

Run with Docker

docker run -t \
  -e NZBGET_HOST=http://nzbget:6789 \
  -e NZBGET_USERNAME=nzbget \
  -e NZBGET_PASSWORD=tegbzn6789 \
  -p 9452:9452 \
  frebib/nzbget-exporter

Run with docker-compose

services:
  nzbget_exporter:
    image: frebib/nzbget-exporter
    tty: true
    environment:
    - NZBGET_HOST=http://nzbget:6789
    - NZBGET_USERNAME=nzbget
    - NZBGET_PASSWORD=tegbzn6789
    ports:
    - 9452:9452

Configuration Options

Configuration should be passed via command-line arguments, or the environment. Every option is described in the --help output, as below:

Usage:
  nzbget-exporter [OPTIONS]

Options:
      --log-level= log verbosity level (trace, debug, info, warn, error, fatal) (default: info) [$LOG_LEVEL]
      --namespace= metric name prefix (default: nzbget) [$NZBGET_METRIC_NAMESPACE]
  -l, --listen=    host:port to listen on (default: :9452) [$NZBGET_LISTEN]
  -h, --host=      nzbget host to export metrics for [$NZBGET_HOST]
  -u, --username=  nzbget username for basicauth [$NZBGET_USERNAME]
  -p, --password=  nzbget password for basicauth [$NZBGET_PASSWORD]

Help Options:
  -h, --help       Show this help message

About

NZBGet Prometheus metrics exporter


Languages

Language:Go 97.7%Language:Dockerfile 2.3%