Sign inSign up

ngosang/urbackup-exporter

By ngosang

Updated almost 3 years ago

Prometheus exporter for UrBackup

Image
Monitoring & observability
2

9.7K

ngosang/urbackup-exporter repository overview

UrBackup Exporter

Latest release Docker Pulls Docker Stars GitHub Repo stars

ko-fi

Docker image source code in GitHub => https://github.com/ngosang/urbackup-exporter

Prometheus exporter for the UrBackup backup system. Tested with UrBackup server 2.4.13.

Inspired by h3po work.

Install

Form source code

Requirements:

pip install -r /requirements.txt

export URBACKUP_SERVER_URL=http://192.168.1.100:55414/x
python urbackup-exporter.py
Docker

Docker images are available in GHCR and DockerHub.

docker pull ghcr.io/ngosang/urbackup-exporter
or
docker pull ngosang/urbackup-exporter
Supported Architectures

The architectures supported by this image are:

ArchitectureDefault tag (Debian)Alpine tag
linux/386YesYes
linux/amd64YesYes
linux/arm/v6NoYes
linux/arm/v7YesYes
linux/arm64/v8YesYes
linux/ppc64leYesYes
linux/s390xYesYes
docker-compose

Compatible with docker-compose v2 schemas:

---
version: '2.1'
services:
  urbackup-exporter:
    image: ghcr.io/ngosang/urbackup-exporter
    container_name: urbackup-exporter
    environment:
      - TZ=Europe/Madrid
      - URBACKUP_SERVER_URL=http://<server_host>:55414/x
      - URBACKUP_SERVER_USERNAME=admin
      - URBACKUP_SERVER_PASSWORD=1234
      - EXPORT_CLIENT_BACKUPS=true
    ports:
      - 9554:9554
    restart: unless-stopped
docker cli
docker run -d \
  --name=urbackup-exporter \
  -e TZ=Europe/Madrid \
  -e URBACKUP_SERVER_URL=http://<server_host>:55414/x \
  -e URBACKUP_SERVER_USERNAME=admin \
  -e URBACKUP_SERVER_PASSWORD=1234 \
  -e EXPORT_CLIENT_BACKUPS=true \
  -p 9554:9554 \
  --restart unless-stopped \
  ghcr.io/ngosang/urbackup-exporter

Configuration

All configuration is done with environment variables.

  • URBACKUP_SERVER_URL: UrBackup server URL including host, port and API endpoint. Example: http://192.168.1.100:55414/x
  • URBACKUP_SERVER_USERNAME: (Optional) Username to login in the server. Only required if authorization is enabled. The default is admin.
  • URBACKUP_SERVER_PASSWORD: (Optional) Password to login in the server. Only required if authorization is enabled. The default is 1234.
  • EXPORT_CLIENT_BACKUPS: (Optional) Export detailed metrics for each client. This option can generate a lot of metrics if there many configured clients. The default is true.
  • LISTEN_PORT: (Optional) The address the exporter should listen on. The default is 9554.
  • LISTEN_ADDRESS: (Optional) The address the exporter should listen on. The default is to listen on all addresses.
  • LOG_LEVEL: (Optional) Log level of the traces. The default is INFO.

Exported metrics

NameTypeDescription
urbackup_client_onlinegaugeWhether or not the client is answering the server
urbackup_client_statusgaugeStatus number, purpose unknown
urbackup_client_lastseengaugeTimestamp the client was last seen online
urbackup_backup_okgaugeWhether or not the last backup was successful
urbackup_backup_issuesgaugeNumber of issues during the last backup
urbackup_backup_lasttimegaugeTimestamp of the last backup
urbackup_backup_number_totalcounterNumber of backups
urbackup_backup_size_totalcounterTotal size of backups in bytes

Prometheus config

Example Prometheus configuration:

scrape_configs:
  - job_name: 'urbackup-exporter'
    static_configs:
      - targets: ['192.168.1.100:9554']

Prometheus / Alertmanager rules

Example Prometheus rules for alerting:

  - alert: UrBackupOutdated
    # 1209600 = 15 days
    expr: time() - urbackup_backup_lasttime{backup_type="file"} > 1209600
    for: 0m
    labels:
      severity: critical
    annotations:
      summary: UrBackup {{ $labels.client_name }} backup is outdated
      description: UrBackup backup is outdated\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}

  - alert: UrBackupFailure
    expr: urbackup_backup_ok{backup_type="file"} == 0
    for: 0m
    labels:
      severity: critical
    annotations:
      summary: UrBackup {{ $labels.client_name }} backup failed
      description: UrBackup backup failed\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}

Grafana dashboard

There is a reference Grafana dashboard in grafana/grafana_dashboard.json.

Tag summary

Content type

Image

Digest

sha256:a493bdbaa

Size

51.1 MB

Last updated

almost 3 years ago

docker pull ngosang/urbackup-exporter