Giter Site home page Giter Site logo

urbackup-exporter's Introduction

UrBackup Exporter

Latest release Docker Pulls Donate PayPal Donate Bitcoin Donate Ethereum

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:

Architecture Default tag (Debian) Alpine tag
linux/386 Yes Yes
linux/amd64 Yes Yes
linux/arm/v6 No Yes
linux/arm/v7 Yes Yes
linux/arm64/v8 Yes Yes
linux/ppc64le Yes Yes
linux/s390x Yes Yes

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

Name Type Description
urbackup_client_online gauge Whether or not the client is answering the server
urbackup_client_status gauge Status number, purpose unknown
urbackup_client_lastseen gauge Timestamp the client was last seen online
urbackup_backup_ok gauge Whether or not the last backup was successful
urbackup_backup_issues gauge Number of issues during the last backup
urbackup_backup_lasttime gauge Timestamp of the last backup
urbackup_backup_number_total counter Number of backups
urbackup_backup_size_total counter Total 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.

urbackup-exporter's People

Contributors

ngosang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.