bareos_exporter
bareos_exporter copied to clipboard
bareos_exporter
Prometheus exporter for bareos data recovery system
Dockerfile
Usage with docker
- Create a .env file containing at least your database password using
DB_PASSWORDvariable. - Run docker image as follows
Using environment variables
docker run --name bareos_exporter -p 9625:9625 -e DB_TYPE=mysql -e DB_NAME=bareos-dir -d vierbergenlars/bareos_exporter:latest
Default variables:
PORT9625 (exporter)DB_TYPEpostgresDB_HOSTlocalhostDB_PORT5432 (postgres)DB_USERbareosDB_NAMEbareosSSL_MODEdisable (postgres only)ENDPOINT/metricsJOB_DAYS7WAIT_FOR_DB0
Using custom Docker CMD
docker run --name bareos_exporter -p 9625:9625 -d vierbergenlars/bareos_exporter:latest -dsn 'mysql://login:password@tcp(host:port)/dbname?parseTime=true'
Troubleshooting
docker run --name bareos_exporter -t -i --rm --entrypoint=/bin/sh vierbergenlars/bareos_exporter:latest
Metrics
Aggregated metrics for all jobs
These metrics are aggregated across all jobs with the same name, type, client and fileset that are in the catalog.
Metrics:
bareos_jobs_run: Total number of jobs that have run with the parameters from the labelsbareos_files_saved: Total number of files saved during all backups with the parameters from the labelsbareos_bytes_saved: Toal number of bytes saved during all backups with the parameters from the labels
Labels:
jobname: Name of the jobjobtype: Type indication of the job (Bis backup,Ois consolidate,Ris restore)client: Name of the client of the jobfileset: Name of the fileset of the job
Metrics for the latest job
These metrics are for the latest job with the same name, type, client and fileset.
The whichjob label indicates what criterium was used to select the latest job.
Metrics:
bareos_last_job_bytes_saved: Number of bytes saved during the latest jobbareos_last_job_files_saved: Number of files saved during the latest jobbareos_last_job_errors: Number of errors that occured during the latest jobbareos_last_job_start_unix_timestamp: Timestamp of the start time of the latest jobbareos_last_job_end_unix_timestamp: Timestamp of the end time of the latest jobbareos_last_job_status: Current status of the latest job. This is a binary metric (0 or 1) The value will be 1 only for thestatuslabel that currently applies for the job
Labels:
jobname: Name of the jobjobtype: Type indication of the job (Bis backup,Ois consolidate,Ris restore)client: Name of the client of the jobfileset: Name of the fileset of the joblast_selector: Selector used for determining the last joblast: The job with the highest start timelast_successful: The job with the highest start time that terminated succesfullylast_successful_full: The job with the highest start time that terminated succesfully and is a full backup
Metrics for pools
These metrics are aggregates for all volumes in a pool
Metrics:
bareos_pool_bytes: Number of bytes stored in a poolbareos_pool_volumes: Number of volumes stored in a pool
Labels:
pool: The pool which the volumes are member ofprunable:trueorfalsedepending on whether there are still jobs referencing the counted volumesexpired:trueorfalsedepending on whether the volume has expired or not
Flags
| Name | Description | Default |
|---|---|---|
| port | Bareos exporter port | 9625 |
| endpoint | Bareos exporter endpoint. | "/metrics" |
| dsn | Data source name of the database that is used by bareos. Protocol can be mysql:// or postgres://. The rest of the string is passed to the database driver. |
"mysql://bareos@unix()/bareos?parseTime=true" "postgres://dbname=bareos sslmode=disable user=bareos password=bareos" "postgres://host=/var/run/postgresql dbname=bareos" |
| job-discovery-days | Number of days to look in the history to discover active jobs. Only jobs that have last run this number of days will be considered for data reporting. | 7 |