项目作者: funbox

项目描述 :
Bacula exporter for Prometheus
高级语言: Go
项目地址: git://github.com/funbox/bacula_exporter.git
创建时间: 2020-11-19T13:51:09Z
项目社区:https://github.com/funbox/bacula_exporter

开源协议:MIT License

下载


Bacula Exporter

Prometheus Exporter for Bacula metrics written in Go.

Overview

Demo

Requirements

Note, that the following dependencies should be satisfied:

Supported backends

Currently we are supporting only PostgreSQL backend.

Features

Prometheus Exporter exposes several metrics.

Latest jobs

Metrics details

Name Exposed informations
bacula_latest_job_files_total Total files saved for server during latest backup for client combined
bacula_latest_job_bytes_total Total bytes saved for server during latest backup for client combined
bacula_latest_job_sched_time Timestamp when the latest job was scheduled
bacula_latest_job_start_time Timestamp when the latest job was started
bacula_latest_job_end_time Timestamp when the latest job was ended

Metrics output example

  1. # TYPE bacula_latest_job_bytes_total gauge
  2. bacula_latest_job_bytes_total{level="F",name="app1-job",status="T"} 2.585135999e+09
  3. bacula_latest_job_bytes_total{level="I",name="app1-job",status="T"} 265559
  4. # TYPE bacula_latest_job_end_time counter
  5. bacula_latest_job_end_time{level="F",name="app1-job",status="T"} 1.60540267e+09
  6. bacula_latest_job_end_time{level="I",name="app1-job",status="T"} 1.605661203e+09
  7. # TYPE bacula_latest_job_files_total gauge
  8. bacula_latest_job_files_total{level="F",name="app1-job",status="T"} 5135
  9. bacula_latest_job_files_total{level="I",name="app1-job",status="T"} 34
  10. # TYPE bacula_latest_job_sched_time counter
  11. bacula_latest_job_sched_time{level="F",name="app1-job",status="T"} 1.605790438e+09
  12. bacula_latest_job_sched_time{level="I",name="app1-job",status="T"} 1.605790438e+09
  13. # TYPE bacula_latest_job_start_time counter
  14. bacula_latest_job_start_time{level="F",name="app1-job",status="T"} 1.605402002e+09
  15. bacula_latest_job_start_time{level="I",name="app1-job",status="T"} 1.605661201e+09

Jobs summary

Metrics details

Name Exposed informations
bacula_summary_job_files_total Total files saved for server during all backups for client combined
bacula_summary_job_bytes_total Total bytes saved for server during all backups for client combined

Metrics output details

  1. # TYPE bacula_summary_job_bytes_total gauge
  2. bacula_summary_job_bytes_total{level="F",name="app1-job"} 5.472818095e+09
  3. bacula_summary_job_bytes_total{level="I",name="app1-job"} 8.4448111e+07
  4. # TYPE bacula_summary_job_files_total gauge
  5. bacula_summary_job_files_total{level="F",name="app1-job"} 10140
  6. bacula_summary_job_files_total{level="I",name="app1-job"} 348

Build

From the source code

  1. make deps
  2. make all

Docker image

  1. make docker

Deploy

Binary

  1. bacula_exporter -c /path/to/bacula_exporter.knf

Docker image

  1. docker pull funbox/bacula_exporter:1.1.0

Usage

Command line

  1. Usage: bacula_exporter {options}
  2. Options
  3. --config, -c file Path to configuraion file
  4. --no-color, -nc Disable colors in output
  5. --help, -h Show this help message
  6. --version, -v Show version

Configuration

  1. [http]
  2. # HTTP server IP
  3. ip: 0.0.0.0
  4. # HTTP server port
  5. port: 33407
  6. # HTTP metrics endpoint
  7. endpoint: /metrics
  8. [db]
  9. # Database name
  10. name: bacula
  11. # Username
  12. username: bacula
  13. # Password
  14. password: keepinsecret
  15. # IP address or FQDN
  16. host: db.example.tld
  17. # Port
  18. port: 5432
  19. # SSL mode
  20. sslmode: disable
  21. [log]
  22. # Log output (file/console)
  23. output: console
  24. # Log file dir
  25. dir: /
  26. # Path to log file
  27. file: {log:dir}/bacula_exporter.log
  28. # Log permissions
  29. perms: 600
  30. # Default log level (debug/info/warn/error/crit)
  31. level: info

Development

Run environment

Run development environment.

  1. docker-compose up -d

Open Grafana (http://127.0.0.1:3000).

Build status

Artifact Status
docker Build Status

Contribute

If you like Bacula Exporter, please give it a star. This will help more people know Bacula Exporter.

Please feel free to send your pull requests.

License

MIT

Sponsored by FunBox