├── VERSION ├── prometheus-borg-exporter.timer ├── borg_exporter.rc ├── prometheus-borg-exporter.service ├── Makefile ├── README.md ├── borg_exporter.sh ├── LICENSE └── borg_backup_status_dashboard.json /VERSION: -------------------------------------------------------------------------------- 1 | 0.2 -------------------------------------------------------------------------------- /prometheus-borg-exporter.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus Borg Exporter Timer 3 | 4 | [Timer] 5 | OnCalendar=*-*-* 08:00:00 6 | 7 | [Install] 8 | WantedBy=timers.target 9 | -------------------------------------------------------------------------------- /borg_exporter.rc: -------------------------------------------------------------------------------- 1 | BORG_PASSPHRASE="" 2 | REPOSITORY="" 3 | PUSHGATEWAY_URL=http://pushgateway.clems4ever.com 4 | BASEREPODIR="/backup" 5 | NODE_EXPORTER_DIR="/path/to/node/exporter/textfile/collector/dir" -------------------------------------------------------------------------------- /prometheus-borg-exporter.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Prometheus Borg Exporter 3 | After=network-online.target 4 | 5 | [Service] 6 | ExecStart=/usr/local/bin/borg_exporter.sh 7 | EnvironmentFile=/etc/borg_exporter.rc 8 | Type=simple 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: install 2 | install: 3 | @cp borg_exporter.sh /usr/local/bin/ \ 4 | && chmod +x /usr/local/bin/borg_exporter.sh \ 5 | && cp -n borg_exporter.rc /etc/borg_exporter.rc \ 6 | && chmod 400 /etc/borg_exporter.rc \ 7 | && cp prometheus-borg-exporter.timer /etc/systemd/system/ \ 8 | && cp prometheus-borg-exporter.service /etc/systemd/system/ \ 9 | && echo -n "Edit the config file /etc/borg_exporter.rc and press [ENTER] when finished "; read _ \ 10 | && systemctl enable prometheus-borg-exporter.timer \ 11 | && systemctl start prometheus-borg-exporter.timer 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Borg exporter 2 | 3 | Export borg information to prometheus. Extended to export information about a list of borg repositories (discovered via `find`), and also to export details about today's backups. 4 | 5 | ## Dependencies 6 | 7 | * [Dateutils](http://www.fresse.org/dateutils/) `sudo apt-get install dateutils` 8 | * Node Exporter with textfile collector 9 | * [Borg](https://github.com/borgbackup/borg) 10 | * binutils (sed, grep, wc, etc) 11 | 12 | ## Install 13 | 14 | ### Manually 15 | Copy `borg_exporter.sh` to `/usr/local/bin`. 16 | 17 | Copy `borg_exporter.rc` to `/etc/` and configure it (see the configuration section below). 18 | 19 | Copy the systemd unit and timer to `/etc/systemd/system`: 20 | ``` 21 | sudo cp prometheus-borg-exporter.* /etc/systemd/system 22 | ``` 23 | and run 24 | 25 | ``` 26 | sudo systemctl enable prometheus-borg-exporter.timer 27 | sudo systemctl start prometheus-borg-exporter.timer 28 | ``` 29 | 30 | Alternative: Use `ExecStartPost` in your borg backup timer itself to write our the metrics. 31 | 32 | ### Config file 33 | The config file has a few options: 34 | ``` 35 | BORG_PASSPHRASE="mysecret" 36 | REPOSITORY="/path/to/repository" 37 | PUSHGATEWAY_URL=http://pushgateway.clems4ever.com 38 | BASEREPODIR="/backup" 39 | NODE_EXPORTER_DIR="/path/to/node/exporter/textfile/collector/dir" 40 | ``` 41 | 42 | * If you leave `BORG_PASSPHRASE=""` empty, no password will be used to access your backups 43 | * `REPOSITORY` should either point to a valid repository (if you're running this on each server you are backing-up) or should be left empty in case you set `BASEREPODIR` 44 | * `PUSHGATEWAY_URL` should be a valid URL for push gateway. If you're not using it, leave it blank (`PUSHGATEWAY_URL=""`) and data will be exported via node_exporter textfile collector 45 | * `BASEREPODIR` should point to a directory on disk from where you want to search for all the repos. This makes sense when you run this exporter on the backup server, so you can access all the backups in one place. It's only taken into consideration when `REPOSITORY=""` 46 | * `NODE_EXPORTER_DIR` should point to your node_exporter textfile collector directory (where it writes .prom files). It's used only if `PUSHGATEWAY_URL=""` 47 | 48 | 49 | ### Caveats 50 | * The repository names shouldn't contain spaces 51 | * The archive names shouldn't contain spaces 52 | * The hostnames from the machines that do the export shouldn't contain spaces 53 | 54 | ### Troubleshooting 55 | You can manually run the script with `bash -x` to get the output of intermediary commands 56 | 57 | ## Exported metrics example 58 | 59 | ``` 60 | # HELP borg_archives_count The total number of archives in the repo 61 | # TYPE borg_archives_count gauge 62 | borg_archives_count{backupserver="my_backup_server",host="server1",repo="/backup/server1/server1"} 3 63 | borg_archives_count{backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 29 64 | # HELP borg_archives_count_today The total number of archives created today in the repo 65 | # TYPE borg_archives_count_today gauge 66 | borg_archives_count_today{backupserver="my_backup_server",host="server1",repo="/backup/server1/server1"} 0 67 | borg_archives_count_today{backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 4 68 | # HELP borg_chunks_total The total number of chunks in the archive (today) 69 | # TYPE borg_chunks_total gauge 70 | borg_chunks_total{archive="_etc",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 11829 71 | borg_chunks_total{archive="_home_user_scripts",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 11829 72 | borg_chunks_total{archive="_usr_share_cacti",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 11829 73 | borg_chunks_total{archive="mysqldump",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 11829 74 | # HELP borg_chunks_unique The number of unique chunks in the archive (today) 75 | # TYPE borg_chunks_unique gauge 76 | borg_chunks_unique{archive="_etc",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 2076 77 | borg_chunks_unique{archive="_home_user_scripts",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 2076 78 | borg_chunks_unique{archive="_usr_share_cacti",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 2076 79 | borg_chunks_unique{archive="_var_spool_cron",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 2076 80 | borg_chunks_unique{archive="mysqldump",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 2076 81 | # HELP borg_files_count The number of files contained in the archive (today) 82 | # TYPE borg_files_count gauge 83 | borg_files_count{archive="_etc",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 1030 84 | borg_files_count{archive="_home_user_scripts",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 36 85 | borg_files_count{archive="_usr_share_cacti",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 593 86 | borg_files_count{archive="_var_spool_cron",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 1 87 | borg_files_count{archive="mysqldump",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 1 88 | # HELP borg_hours_from_last_archive How many hours have passed since the last archive was added to the repo (counted by borg_exporter.sh) 89 | # TYPE borg_hours_from_last_archive gauge 90 | borg_hours_from_last_archive{backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 10 91 | # HELP borg_last_archive_timestamp The timestamp of the last archive (unixtimestamp) 92 | # TYPE borg_last_archive_timestamp gauge 93 | borg_last_archive_timestamp{backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 1.622421272e+09 94 | # HELP borg_last_size The size of the archive (today) 95 | # TYPE borg_last_size gauge 96 | borg_last_size{archive="_etc",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 2.43479e+07 97 | borg_last_size{archive="_home_user_scripts",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 146749 98 | borg_last_size{archive="_usr_share_cacti",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 1.09157e+07 99 | borg_last_size{archive="_var_spool_cron",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 1177.6 100 | borg_last_size{archive="mysqldump",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 8.32286e+08 101 | # HELP borg_last_size_compressed The compressed size of the archive (today) 102 | # TYPE borg_last_size_compressed gauge 103 | borg_last_size_compressed{archive="_etc",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 8.40958e+06 104 | borg_last_size_compressed{archive="_home_user_scripts",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 44769.3 105 | borg_last_size_compressed{archive="_usr_share_cacti",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 5.05414e+06 106 | borg_last_size_compressed{archive="_var_spool_cron",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 445 107 | borg_last_size_compressed{archive="mysqldump",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 5.55326e+07 108 | # HELP borg_last_size_dedup The deduplicated size of the archive (today), (size on disk) 109 | # TYPE borg_last_size_dedup gauge 110 | borg_last_size_dedup{archive="_etc",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 608 111 | borg_last_size_dedup{archive="_home_user_scripts",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 558 112 | borg_last_size_dedup{archive="_usr_share_cacti",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 536 113 | borg_last_size_dedup{archive="_var_spool_cron",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 548 114 | borg_last_size_dedup{archive="mysqldump",backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 9.81467e+06 115 | # HELP borg_total_size The total size of all archives in the repo 116 | # TYPE borg_total_size gauge 117 | borg_total_size{backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 5.35797e+09 118 | # HELP borg_total_size_compressed The total compressed size of all archives in the repo 119 | # TYPE borg_total_size_compressed gauge 120 | borg_total_size_compressed{backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 4.17637e+08 121 | # HELP borg_total_size_dedup The total deduplicated size of all archives in the repo (size on disk) 122 | # TYPE borg_total_size_dedup gauge 123 | borg_total_size_dedup{backupserver="my_backup_server",host="server2",repo="/backup/server2/server2"} 1.14284e+08 124 | ``` 125 | 126 | ### Grafana dashboard 127 | 128 | See [here](https://grafana.com/dashboards/14516) for a sample grafana dashboard. 129 | The original dashboard code is also available as `borg_backup_status_dashboard.json` in the repo. 130 | -------------------------------------------------------------------------------- /borg_exporter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/borg_exporter.rc 4 | 5 | TMP_FILE=$(mktemp /tmp/prometheus-borg-XXXXX) 6 | DATEDIFF=`which datediff` 7 | if [ -z "$DATEDIFF" ]; then 8 | #ubuntu packages have a different executable name 9 | DATEDIFF=`which dateutils.ddiff` 10 | fi 11 | 12 | [ -e $TMP_FILE ] && rm -f $TMP_FILE 13 | 14 | #prevent "Attempting to access a previously unknown unencrypted repository" prompt 15 | export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes 16 | export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes 17 | HOSTNAME=$(hostname) 18 | 19 | function calc_bytes { 20 | NUM=$1 21 | UNIT=$2 22 | 23 | case "$UNIT" in 24 | kB) 25 | echo $NUM | awk '{ print $1 * 1024 }' 26 | ;; 27 | MB) 28 | echo $NUM | awk '{ print $1 * 1024 * 1024 }' 29 | ;; 30 | GB) 31 | echo $NUM | awk '{ print $1 * 1024 * 1024 * 1024 }' 32 | ;; 33 | TB) 34 | echo $NUM | awk '{ print $1 * 1024 * 1024 * 1024 * 1024 }' 35 | ;; 36 | B) 37 | echo $NUM | awk '{ print $1 }' 38 | ;; 39 | esac 40 | } 41 | 42 | 43 | function getBorgDataForRepository { 44 | REPOSITORY=$1 #repository we're looking into 45 | host=$2 #the host for which the backups are made 46 | 47 | ARCHIVES="$(BORG_PASSPHRASE=$BORG_PASSPHRASE borg list $REPOSITORY)" 48 | COUNTER=0 49 | BACKUPS_TODAY_COUNT=0 50 | 51 | COUNTER=$(echo "$ARCHIVES" | wc -l) 52 | TODAY=$(date +%Y-%m-%d) 53 | BACKUPS_TODAY=$(echo "$ARCHIVES" | grep ", $TODAY ") 54 | BACKUPS_TODAY_COUNT=$(echo -n "$BACKUPS_TODAY" | wc -l) 55 | 56 | #extract data for last archive 57 | LAST_ARCHIVE=$(BORG_PASSPHRASE=$BORG_PASSPHRASE borg list --last 1 $REPOSITORY) 58 | #we need at least one valid backup to list anything meaningfull 59 | if [ -n "${LAST_ARCHIVE}" ] 60 | then 61 | LAST_ARCHIVE_NAME=$(echo $LAST_ARCHIVE | awk '{print $1}') 62 | LAST_ARCHIVE_DATE=$(echo $LAST_ARCHIVE | awk '{print $3" "$4}') 63 | LAST_ARCHIVE_TIMESTAMP=$(date -d "$LAST_ARCHIVE_DATE" +"%s") 64 | CURRENT_DATE="$(date '+%Y-%m-%d %H:%M:%S')" 65 | NB_HOUR_FROM_LAST_BCK=$($DATEDIFF "$LAST_ARCHIVE_DATE" "$CURRENT_DATE" -f '%H') 66 | 67 | # in case the date parsing from BORG didn't work (e.g. archive with space in it), datediff will output 68 | # a usage message on stdout and will break prometheus formatting. We need to 69 | # check for that here 70 | DATEDIFF_LINES=$(echo "$NB_HOUR_FROM_LAST_BCK" | wc -l) 71 | if [ "${DATEDIFF_LINES}" -eq 1 ] 72 | then 73 | 74 | echo "borg_hours_from_last_archive{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\"} $NB_HOUR_FROM_LAST_BCK" >> $TMP_FILE 75 | 76 | BORG_INFO=$(BORG_PASSPHRASE="$BORG_PASSPHRASE" borg info "$REPOSITORY::$LAST_ARCHIVE_NAME") 77 | echo "borg_last_archive_timestamp{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\"} $LAST_ARCHIVE_TIMESTAMP" >> $TMP_FILE 78 | 79 | TOTAL_SIZE=$(calc_bytes $(echo "$BORG_INFO" |grep "All archives" |awk '{print $3}') $(echo "$BORG_INFO" |grep "All archives" |awk '{print $4}')) 80 | TOTAL_SIZE_COMPRESSED=$(calc_bytes $(echo "$BORG_INFO" |grep "All archives" |awk '{print $5}') $(echo "$BORG_INFO" |grep "All archives" |awk '{print $6}')) 81 | TOTAL_SIZE_DEDUP=$(calc_bytes $(echo "$BORG_INFO" |grep "All archives" |awk '{print $7}') $(echo "$BORG_INFO" |grep "All archives" |awk '{print $8}')) 82 | 83 | 84 | echo "borg_total_size{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\"} $TOTAL_SIZE" >> $TMP_FILE 85 | echo "borg_total_size_compressed{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\"} $TOTAL_SIZE_COMPRESSED" >> $TMP_FILE 86 | echo "borg_total_size_dedup{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\"} $TOTAL_SIZE_DEDUP" >> $TMP_FILE 87 | 88 | fi 89 | 90 | echo "borg_archives_count{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\"} $COUNTER" >> $TMP_FILE 91 | echo "borg_archives_count_today{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\"} $BACKUPS_TODAY_COUNT" >> $TMP_FILE 92 | 93 | #go through the day's archives and count the files/chunks/etc. 94 | 95 | TODAY_ARCHIVES=$(echo -n "$BACKUPS_TODAY" | awk '{print $1}' | xargs echo ) 96 | #echo $TODAY_ARCHIVES 97 | if [ -n "${TODAY_ARCHIVES}" ] 98 | then 99 | for archive in $TODAY_ARCHIVES 100 | do 101 | echo "Looking at $REPOSITORY::$archive" 102 | #ask for an info on it 103 | CURRENT_INFO=$(BORG_PASSPHRASE="$BORG_PASSPHRASE" borg info "$REPOSITORY::$archive") 104 | #cut out something that looks like a timestamp when reporting: 20210528-1315 105 | readable_archive=$(echo $archive | sed -r "s/-[0-9]{8}-[0-9]{4,6}//") 106 | 107 | echo "borg_files_count{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\", archive=\"$readable_archive\"} $(echo "$CURRENT_INFO" | grep "Number of files" | awk '{print $4}')" >> $TMP_FILE 108 | echo "borg_chunks_unique{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\", archive=\"$readable_archive\"} $(echo "$CURRENT_INFO" | grep "Chunk index" | awk '{print $3}')" >> $TMP_FILE 109 | echo "borg_chunks_total{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\", archive=\"$readable_archive\"} $(echo "$CURRENT_INFO" | grep "Chunk index" | awk '{print $4}')" >> $TMP_FILE 110 | 111 | # byte size 112 | LAST_SIZE=$(calc_bytes $(echo "$CURRENT_INFO" |grep "This archive" |awk '{print $3}') $(echo "$CURRENT_INFO" |grep "This archive" |awk '{print $4}')) 113 | LAST_SIZE_COMPRESSED=$(calc_bytes $(echo "$CURRENT_INFO" |grep "This archive" |awk '{print $5}') $(echo "$CURRENT_INFO" |grep "This archive" |awk '{print $6}')) 114 | LAST_SIZE_DEDUP=$(calc_bytes $(echo "$CURRENT_INFO" |grep "This archive" |awk '{print $7}') $(echo "$CURRENT_INFO" |grep "This archive" |awk '{print $8}')) 115 | 116 | echo "borg_last_size{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\", archive=\"$readable_archive\"} $LAST_SIZE" >> $TMP_FILE 117 | echo "borg_last_size_compressed{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\", archive=\"$readable_archive\"} $LAST_SIZE_COMPRESSED" >> $TMP_FILE 118 | echo "borg_last_size_dedup{host=\"$host\", backupserver=\"$HOSTNAME\", repo=\"$REPOSITORY\", archive=\"$readable_archive\"} $LAST_SIZE_DEDUP" >> $TMP_FILE 119 | done 120 | else 121 | echo "Unable to find any archives for today in $REPOSITORY." 122 | fi 123 | else 124 | echo "Unable to find any archives in $REPOSITORY. Processing skipped for it" 125 | fi 126 | } 127 | 128 | #print the definition of the metrics 129 | echo "# HELP borg_hours_from_last_archive How many hours have passed since the last archive was added to the repo (counted by borg_exporter.sh)" >> $TMP_FILE 130 | echo "# TYPE borg_hours_from_last_archive gauge" >> $TMP_FILE 131 | echo "# HELP borg_last_archive_timestamp The timestamp of the last archive (unixtimestamp)" >> $TMP_FILE 132 | echo "# TYPE borg_last_archive_timestamp gauge" >> $TMP_FILE 133 | echo "# HELP borg_total_size The total size of all archives in the repo" >> $TMP_FILE 134 | echo "# TYPE borg_total_size gauge" >> $TMP_FILE 135 | echo "# HELP borg_total_size_compressed The total compressed size of all archives in the repo" >> $TMP_FILE 136 | echo "# TYPE borg_total_size_compressed gauge" >> $TMP_FILE 137 | echo "# HELP borg_total_size_dedup The total deduplicated size of all archives in the repo (size on disk)" >> $TMP_FILE 138 | echo "# TYPE borg_total_size_dedup gauge" >> $TMP_FILE 139 | echo "# HELP borg_archives_count The total number of archives in the repo" >> $TMP_FILE 140 | echo "# TYPE borg_archives_count gauge" >> $TMP_FILE 141 | echo "# HELP borg_archives_count_today The total number of archives created today in the repo" >> $TMP_FILE 142 | echo "# TYPE borg_archives_count_today gauge" >> $TMP_FILE 143 | echo "# HELP borg_files_count The number of files contained in the archive (today)" >> $TMP_FILE 144 | echo "# TYPE borg_files_count gauge" >> $TMP_FILE 145 | echo "# HELP borg_chunks_unique The number of unique chunks in the archive (today)" >> $TMP_FILE 146 | echo "# TYPE borg_chunks_unique gauge" >> $TMP_FILE 147 | echo "# HELP borg_chunks_total The total number of chunks in the archive (today)" >> $TMP_FILE 148 | echo "# TYPE borg_chunks_total gauge" >> $TMP_FILE 149 | echo "# HELP borg_last_size The size of the archive (today)" >> $TMP_FILE 150 | echo "# TYPE borg_last_size gauge" >> $TMP_FILE 151 | echo "# HELP borg_last_size_compressed The compressed size of the archive (today)" >> $TMP_FILE 152 | echo "# TYPE borg_last_size_compressed gauge" >> $TMP_FILE 153 | echo "# HELP borg_last_size_dedup The deduplicated size of the archive (today), (size on disk)" >> $TMP_FILE 154 | echo "# TYPE borg_last_size_dedup gauge" >> $TMP_FILE 155 | 156 | if [ -n "${REPOSITORY}" ] 157 | then 158 | getBorgDataForRepository "${REPOSITORY}" "${HOSTNAME}" 159 | else 160 | #discover (recursively) borg repositories starting from a path and extract info for each 161 | #(e.g. when running on the backup server directly) 162 | if [ -d "${BASEREPODIR}" ] 163 | then 164 | REPOS=`find "$BASEREPODIR" -type f -name "README" | grep -v ".cache/borg"` 165 | # e.g. /backup/servers/server_name/README 166 | for REPO in $REPOS 167 | do 168 | #cut out the /README from the name 169 | REPO=$(echo "$REPO" | sed -r "s/\/README//") 170 | #assume the name convention for the repo contains the hostname as the repo name 171 | # e.g. /backup/servers/server_name 172 | host=$(basename "$REPO") 173 | getBorgDataForRepository $REPO $host 174 | done 175 | else 176 | echo "Error: Either set REPOSITORY or BASEREPODIR in /etc/borg_exporter.rc" 177 | fi 178 | 179 | fi 180 | 181 | if [ -n "${PUSHGATEWAY_URL}" ] 182 | then 183 | #send data via pushgateway 184 | cat $TMP_FILE | curl --data-binary @- ${PUSHGATEWAY_URL}/metrics/job/borg-exporter/host/$HOSTNAME/repository/$REPOSITORY 185 | else 186 | #send data via node_exporter 187 | if [ -d "${NODE_EXPORTER_DIR}" ] 188 | then 189 | cp $TMP_FILE ${NODE_EXPORTER_DIR}/borg_exporter.prom 190 | else 191 | echo "Please configure either PUSHGATEWAY_URL or NODE_EXPORTER_DIR in /etc/borg_exporter.rc" 192 | fi 193 | fi 194 | #cleanup 195 | rm -f $TMP_FILE 196 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /borg_backup_status_dashboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PROMETHEUS", 5 | "label": "Prometheus", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "prometheus", 9 | "pluginName": "Prometheus" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "panel", 15 | "id": "bargauge", 16 | "name": "Bar gauge", 17 | "version": "" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "gauge", 22 | "name": "Gauge", 23 | "version": "" 24 | }, 25 | { 26 | "type": "grafana", 27 | "id": "grafana", 28 | "name": "Grafana", 29 | "version": "7.3.3" 30 | }, 31 | { 32 | "type": "datasource", 33 | "id": "prometheus", 34 | "name": "Prometheus", 35 | "version": "1.0.0" 36 | }, 37 | { 38 | "type": "panel", 39 | "id": "stat", 40 | "name": "Stat", 41 | "version": "" 42 | } 43 | ], 44 | "annotations": { 45 | "list": [ 46 | { 47 | "builtIn": 1, 48 | "datasource": "-- Grafana --", 49 | "enable": true, 50 | "hide": true, 51 | "iconColor": "rgba(0, 211, 255, 1)", 52 | "name": "Annotations & Alerts", 53 | "type": "dashboard" 54 | } 55 | ] 56 | }, 57 | "description": "Status of borg backup", 58 | "editable": true, 59 | "gnetId": null, 60 | "graphTooltip": 0, 61 | "id": null, 62 | "iteration": 1622465496087, 63 | "links": [], 64 | "panels": [ 65 | { 66 | "collapsed": false, 67 | "datasource": "${DS_PROMETHEUS}", 68 | "gridPos": { 69 | "h": 1, 70 | "w": 24, 71 | "x": 0, 72 | "y": 0 73 | }, 74 | "id": 2, 75 | "panels": [], 76 | "title": "Backup server stats", 77 | "type": "row" 78 | }, 79 | { 80 | "datasource": "${DS_PROMETHEUS}", 81 | "description": "Number of repos on server", 82 | "fieldConfig": { 83 | "defaults": { 84 | "custom": {}, 85 | "mappings": [], 86 | "thresholds": { 87 | "mode": "absolute", 88 | "steps": [ 89 | { 90 | "color": "green", 91 | "value": null 92 | } 93 | ] 94 | } 95 | }, 96 | "overrides": [] 97 | }, 98 | "gridPos": { 99 | "h": 3, 100 | "w": 3, 101 | "x": 0, 102 | "y": 1 103 | }, 104 | "id": 5, 105 | "options": { 106 | "colorMode": "value", 107 | "graphMode": "area", 108 | "justifyMode": "auto", 109 | "orientation": "auto", 110 | "reduceOptions": { 111 | "calcs": [ 112 | "mean" 113 | ], 114 | "fields": "", 115 | "values": false 116 | }, 117 | "textMode": "auto" 118 | }, 119 | "pluginVersion": "7.3.3", 120 | "targets": [ 121 | { 122 | "expr": "count(count by (repo) (borg_archives_count{backupserver=\"$backupserver\"}))", 123 | "interval": "", 124 | "legendFormat": "", 125 | "refId": "A" 126 | } 127 | ], 128 | "timeFrom": null, 129 | "timeShift": null, 130 | "title": "Total repos", 131 | "type": "stat" 132 | }, 133 | { 134 | "datasource": "${DS_PROMETHEUS}", 135 | "description": "Number of archives in all repos", 136 | "fieldConfig": { 137 | "defaults": { 138 | "custom": {}, 139 | "mappings": [], 140 | "thresholds": { 141 | "mode": "absolute", 142 | "steps": [ 143 | { 144 | "color": "green", 145 | "value": null 146 | } 147 | ] 148 | } 149 | }, 150 | "overrides": [] 151 | }, 152 | "gridPos": { 153 | "h": 3, 154 | "w": 3, 155 | "x": 3, 156 | "y": 1 157 | }, 158 | "id": 6, 159 | "options": { 160 | "colorMode": "value", 161 | "graphMode": "area", 162 | "justifyMode": "auto", 163 | "orientation": "auto", 164 | "reduceOptions": { 165 | "calcs": [ 166 | "mean" 167 | ], 168 | "fields": "", 169 | "values": false 170 | }, 171 | "textMode": "auto" 172 | }, 173 | "pluginVersion": "7.3.3", 174 | "targets": [ 175 | { 176 | "expr": "sum(borg_archives_count{backupserver=\"$backupserver\"})", 177 | "interval": "", 178 | "legendFormat": "", 179 | "refId": "A" 180 | } 181 | ], 182 | "timeFrom": null, 183 | "timeShift": null, 184 | "title": "Total archives", 185 | "type": "stat" 186 | }, 187 | { 188 | "datasource": "${DS_PROMETHEUS}", 189 | "description": "Size of all the data, uncompressed", 190 | "fieldConfig": { 191 | "defaults": { 192 | "custom": {}, 193 | "mappings": [], 194 | "thresholds": { 195 | "mode": "absolute", 196 | "steps": [ 197 | { 198 | "color": "semi-dark-blue", 199 | "value": null 200 | } 201 | ] 202 | }, 203 | "unit": "decbytes" 204 | }, 205 | "overrides": [] 206 | }, 207 | "gridPos": { 208 | "h": 3, 209 | "w": 4, 210 | "x": 6, 211 | "y": 1 212 | }, 213 | "id": 13, 214 | "options": { 215 | "colorMode": "value", 216 | "graphMode": "area", 217 | "justifyMode": "auto", 218 | "orientation": "auto", 219 | "reduceOptions": { 220 | "calcs": [ 221 | "mean" 222 | ], 223 | "fields": "", 224 | "values": false 225 | }, 226 | "textMode": "auto" 227 | }, 228 | "pluginVersion": "7.3.3", 229 | "targets": [ 230 | { 231 | "expr": "sum(borg_total_size{backupserver=\"$backupserver\"})", 232 | "interval": "", 233 | "legendFormat": "", 234 | "refId": "A" 235 | } 236 | ], 237 | "timeFrom": null, 238 | "timeShift": null, 239 | "title": "Uncompressed size", 240 | "type": "stat" 241 | }, 242 | { 243 | "datasource": "${DS_PROMETHEUS}", 244 | "description": "Size of all the data, compressed", 245 | "fieldConfig": { 246 | "defaults": { 247 | "custom": {}, 248 | "mappings": [], 249 | "thresholds": { 250 | "mode": "absolute", 251 | "steps": [ 252 | { 253 | "color": "light-orange", 254 | "value": null 255 | } 256 | ] 257 | }, 258 | "unit": "decbytes" 259 | }, 260 | "overrides": [] 261 | }, 262 | "gridPos": { 263 | "h": 3, 264 | "w": 4, 265 | "x": 10, 266 | "y": 1 267 | }, 268 | "id": 14, 269 | "options": { 270 | "colorMode": "value", 271 | "graphMode": "area", 272 | "justifyMode": "auto", 273 | "orientation": "auto", 274 | "reduceOptions": { 275 | "calcs": [ 276 | "mean" 277 | ], 278 | "fields": "", 279 | "values": false 280 | }, 281 | "textMode": "auto" 282 | }, 283 | "pluginVersion": "7.3.3", 284 | "targets": [ 285 | { 286 | "expr": "sum(borg_total_size_compressed{backupserver=\"$backupserver\"})", 287 | "interval": "", 288 | "legendFormat": "", 289 | "refId": "A" 290 | } 291 | ], 292 | "timeFrom": null, 293 | "timeShift": null, 294 | "title": "Compressed size", 295 | "type": "stat" 296 | }, 297 | { 298 | "datasource": "${DS_PROMETHEUS}", 299 | "description": "Size of all the data, compressed and deduplicated", 300 | "fieldConfig": { 301 | "defaults": { 302 | "custom": {}, 303 | "decimals": 1, 304 | "mappings": [], 305 | "thresholds": { 306 | "mode": "absolute", 307 | "steps": [ 308 | { 309 | "color": "green", 310 | "value": null 311 | } 312 | ] 313 | }, 314 | "unit": "decbytes" 315 | }, 316 | "overrides": [] 317 | }, 318 | "gridPos": { 319 | "h": 3, 320 | "w": 4, 321 | "x": 14, 322 | "y": 1 323 | }, 324 | "id": 15, 325 | "options": { 326 | "colorMode": "value", 327 | "graphMode": "area", 328 | "justifyMode": "auto", 329 | "orientation": "auto", 330 | "reduceOptions": { 331 | "calcs": [ 332 | "mean" 333 | ], 334 | "fields": "", 335 | "values": false 336 | }, 337 | "textMode": "auto" 338 | }, 339 | "pluginVersion": "7.3.3", 340 | "targets": [ 341 | { 342 | "expr": "sum(borg_total_size_dedup{backupserver=\"$backupserver\"})", 343 | "interval": "", 344 | "legendFormat": "", 345 | "refId": "A" 346 | } 347 | ], 348 | "timeFrom": null, 349 | "timeShift": null, 350 | "title": "Deduplicated size", 351 | "type": "stat" 352 | }, 353 | { 354 | "datasource": "${DS_PROMETHEUS}", 355 | "description": "How much space you are saving with compression and deduplication", 356 | "fieldConfig": { 357 | "defaults": { 358 | "custom": {}, 359 | "decimals": 1, 360 | "mappings": [], 361 | "thresholds": { 362 | "mode": "absolute", 363 | "steps": [ 364 | { 365 | "color": "dark-red", 366 | "value": null 367 | }, 368 | { 369 | "color": "#EAB839", 370 | "value": 70 371 | }, 372 | { 373 | "color": "dark-green", 374 | "value": 85 375 | } 376 | ] 377 | }, 378 | "unit": "percent" 379 | }, 380 | "overrides": [] 381 | }, 382 | "gridPos": { 383 | "h": 3, 384 | "w": 4, 385 | "x": 18, 386 | "y": 1 387 | }, 388 | "id": 16, 389 | "options": { 390 | "orientation": "auto", 391 | "reduceOptions": { 392 | "calcs": [ 393 | "mean" 394 | ], 395 | "fields": "", 396 | "values": false 397 | }, 398 | "showThresholdLabels": false, 399 | "showThresholdMarkers": true 400 | }, 401 | "pluginVersion": "7.3.3", 402 | "targets": [ 403 | { 404 | "expr": "100-sum(borg_total_size_dedup{backupserver=\"$backupserver\"})/sum(borg_total_size{backupserver=\"$backupserver\"})*100", 405 | "interval": "", 406 | "legendFormat": "", 407 | "refId": "A" 408 | } 409 | ], 410 | "timeFrom": null, 411 | "timeShift": null, 412 | "title": "Disk saving %", 413 | "type": "gauge" 414 | }, 415 | { 416 | "collapsed": false, 417 | "datasource": "${DS_PROMETHEUS}", 418 | "gridPos": { 419 | "h": 1, 420 | "w": 24, 421 | "x": 0, 422 | "y": 4 423 | }, 424 | "id": 18, 425 | "panels": [], 426 | "title": "Backup server stats (today's backups)", 427 | "type": "row" 428 | }, 429 | { 430 | "datasource": "${DS_PROMETHEUS}", 431 | "description": "Number of repos on server", 432 | "fieldConfig": { 433 | "defaults": { 434 | "custom": {}, 435 | "mappings": [], 436 | "thresholds": { 437 | "mode": "absolute", 438 | "steps": [ 439 | { 440 | "color": "green", 441 | "value": null 442 | } 443 | ] 444 | } 445 | }, 446 | "overrides": [] 447 | }, 448 | "gridPos": { 449 | "h": 6, 450 | "w": 3, 451 | "x": 0, 452 | "y": 5 453 | }, 454 | "id": 20, 455 | "options": { 456 | "colorMode": "value", 457 | "graphMode": "area", 458 | "justifyMode": "auto", 459 | "orientation": "auto", 460 | "reduceOptions": { 461 | "calcs": [ 462 | "mean" 463 | ], 464 | "fields": "", 465 | "values": false 466 | }, 467 | "textMode": "auto" 468 | }, 469 | "pluginVersion": "7.3.3", 470 | "targets": [ 471 | { 472 | "expr": "count(count by (repo) (borg_archives_count_today{backupserver=\"$backupserver\"} >0))", 473 | "interval": "", 474 | "legendFormat": "", 475 | "refId": "A" 476 | } 477 | ], 478 | "timeFrom": null, 479 | "timeShift": null, 480 | "title": "Total repos", 481 | "type": "stat" 482 | }, 483 | { 484 | "datasource": "${DS_PROMETHEUS}", 485 | "description": "Number of archives in all repos", 486 | "fieldConfig": { 487 | "defaults": { 488 | "custom": {}, 489 | "mappings": [], 490 | "thresholds": { 491 | "mode": "absolute", 492 | "steps": [ 493 | { 494 | "color": "green", 495 | "value": null 496 | } 497 | ] 498 | } 499 | }, 500 | "overrides": [] 501 | }, 502 | "gridPos": { 503 | "h": 6, 504 | "w": 3, 505 | "x": 3, 506 | "y": 5 507 | }, 508 | "id": 22, 509 | "options": { 510 | "colorMode": "value", 511 | "graphMode": "area", 512 | "justifyMode": "auto", 513 | "orientation": "auto", 514 | "reduceOptions": { 515 | "calcs": [ 516 | "mean" 517 | ], 518 | "fields": "", 519 | "values": false 520 | }, 521 | "textMode": "auto" 522 | }, 523 | "pluginVersion": "7.3.3", 524 | "targets": [ 525 | { 526 | "expr": "sum(borg_archives_count_today{backupserver=\"$backupserver\"})", 527 | "interval": "", 528 | "legendFormat": "", 529 | "refId": "A" 530 | } 531 | ], 532 | "timeFrom": null, 533 | "timeShift": null, 534 | "title": "Total archives", 535 | "type": "stat" 536 | }, 537 | { 538 | "datasource": "${DS_PROMETHEUS}", 539 | "description": "Size of all the data, uncompressed", 540 | "fieldConfig": { 541 | "defaults": { 542 | "custom": {}, 543 | "decimals": 1, 544 | "mappings": [], 545 | "thresholds": { 546 | "mode": "absolute", 547 | "steps": [ 548 | { 549 | "color": "semi-dark-blue", 550 | "value": null 551 | } 552 | ] 553 | }, 554 | "unit": "decbytes" 555 | }, 556 | "overrides": [] 557 | }, 558 | "gridPos": { 559 | "h": 3, 560 | "w": 4, 561 | "x": 6, 562 | "y": 5 563 | }, 564 | "id": 24, 565 | "options": { 566 | "colorMode": "value", 567 | "graphMode": "area", 568 | "justifyMode": "auto", 569 | "orientation": "auto", 570 | "reduceOptions": { 571 | "calcs": [ 572 | "mean" 573 | ], 574 | "fields": "", 575 | "values": false 576 | }, 577 | "textMode": "auto" 578 | }, 579 | "pluginVersion": "7.3.3", 580 | "targets": [ 581 | { 582 | "expr": "sum(borg_last_size{backupserver=\"$backupserver\"})", 583 | "interval": "", 584 | "legendFormat": "", 585 | "refId": "A" 586 | } 587 | ], 588 | "timeFrom": null, 589 | "timeShift": null, 590 | "title": "Uncompressed size", 591 | "type": "stat" 592 | }, 593 | { 594 | "datasource": "${DS_PROMETHEUS}", 595 | "description": "Size of all the data, compressed", 596 | "fieldConfig": { 597 | "defaults": { 598 | "custom": {}, 599 | "decimals": 1, 600 | "mappings": [], 601 | "thresholds": { 602 | "mode": "absolute", 603 | "steps": [ 604 | { 605 | "color": "light-orange", 606 | "value": null 607 | } 608 | ] 609 | }, 610 | "unit": "decbytes" 611 | }, 612 | "overrides": [] 613 | }, 614 | "gridPos": { 615 | "h": 3, 616 | "w": 4, 617 | "x": 10, 618 | "y": 5 619 | }, 620 | "id": 25, 621 | "options": { 622 | "colorMode": "value", 623 | "graphMode": "area", 624 | "justifyMode": "auto", 625 | "orientation": "auto", 626 | "reduceOptions": { 627 | "calcs": [ 628 | "mean" 629 | ], 630 | "fields": "", 631 | "values": false 632 | }, 633 | "textMode": "auto" 634 | }, 635 | "pluginVersion": "7.3.3", 636 | "targets": [ 637 | { 638 | "expr": "sum(borg_last_size_compressed{backupserver=\"$backupserver\"})", 639 | "interval": "", 640 | "legendFormat": "", 641 | "refId": "A" 642 | } 643 | ], 644 | "timeFrom": null, 645 | "timeShift": null, 646 | "title": "Compressed size", 647 | "type": "stat" 648 | }, 649 | { 650 | "datasource": "${DS_PROMETHEUS}", 651 | "description": "Size of all the data, compressed and deduplicated", 652 | "fieldConfig": { 653 | "defaults": { 654 | "custom": {}, 655 | "decimals": 1, 656 | "mappings": [], 657 | "thresholds": { 658 | "mode": "absolute", 659 | "steps": [ 660 | { 661 | "color": "green", 662 | "value": null 663 | } 664 | ] 665 | }, 666 | "unit": "decbytes" 667 | }, 668 | "overrides": [] 669 | }, 670 | "gridPos": { 671 | "h": 3, 672 | "w": 4, 673 | "x": 14, 674 | "y": 5 675 | }, 676 | "id": 26, 677 | "options": { 678 | "colorMode": "value", 679 | "graphMode": "area", 680 | "justifyMode": "auto", 681 | "orientation": "auto", 682 | "reduceOptions": { 683 | "calcs": [ 684 | "mean" 685 | ], 686 | "fields": "", 687 | "values": false 688 | }, 689 | "textMode": "auto" 690 | }, 691 | "pluginVersion": "7.3.3", 692 | "targets": [ 693 | { 694 | "expr": "sum(borg_last_size_dedup{backupserver=\"$backupserver\"})", 695 | "interval": "", 696 | "legendFormat": "", 697 | "refId": "A" 698 | } 699 | ], 700 | "timeFrom": null, 701 | "timeShift": null, 702 | "title": "Deduplicated size", 703 | "type": "stat" 704 | }, 705 | { 706 | "datasource": "${DS_PROMETHEUS}", 707 | "description": "How much space you are saving with compression and deduplication", 708 | "fieldConfig": { 709 | "defaults": { 710 | "custom": {}, 711 | "decimals": 1, 712 | "mappings": [], 713 | "thresholds": { 714 | "mode": "absolute", 715 | "steps": [ 716 | { 717 | "color": "dark-red", 718 | "value": null 719 | }, 720 | { 721 | "color": "#EAB839", 722 | "value": 70 723 | }, 724 | { 725 | "color": "dark-green", 726 | "value": 85 727 | } 728 | ] 729 | }, 730 | "unit": "percent" 731 | }, 732 | "overrides": [] 733 | }, 734 | "gridPos": { 735 | "h": 6, 736 | "w": 4, 737 | "x": 18, 738 | "y": 5 739 | }, 740 | "id": 27, 741 | "options": { 742 | "orientation": "auto", 743 | "reduceOptions": { 744 | "calcs": [ 745 | "mean" 746 | ], 747 | "fields": "", 748 | "values": false 749 | }, 750 | "showThresholdLabels": false, 751 | "showThresholdMarkers": true 752 | }, 753 | "pluginVersion": "7.3.3", 754 | "targets": [ 755 | { 756 | "expr": "100-sum(borg_last_size_dedup{backupserver=\"$backupserver\"})/sum(borg_last_size{backupserver=\"$backupserver\"})*100", 757 | "interval": "", 758 | "legendFormat": "", 759 | "refId": "A" 760 | } 761 | ], 762 | "timeFrom": null, 763 | "timeShift": null, 764 | "title": "Disk saving %", 765 | "type": "gauge" 766 | }, 767 | { 768 | "datasource": "${DS_PROMETHEUS}", 769 | "description": "Number of files in all repos", 770 | "fieldConfig": { 771 | "defaults": { 772 | "custom": {}, 773 | "mappings": [], 774 | "thresholds": { 775 | "mode": "absolute", 776 | "steps": [ 777 | { 778 | "color": "green", 779 | "value": null 780 | } 781 | ] 782 | }, 783 | "unit": "short" 784 | }, 785 | "overrides": [] 786 | }, 787 | "gridPos": { 788 | "h": 3, 789 | "w": 3, 790 | "x": 6, 791 | "y": 8 792 | }, 793 | "id": 10, 794 | "options": { 795 | "colorMode": "value", 796 | "graphMode": "area", 797 | "justifyMode": "auto", 798 | "orientation": "auto", 799 | "reduceOptions": { 800 | "calcs": [ 801 | "mean" 802 | ], 803 | "fields": "", 804 | "values": false 805 | }, 806 | "textMode": "auto" 807 | }, 808 | "pluginVersion": "7.3.3", 809 | "targets": [ 810 | { 811 | "expr": "sum(borg_files_count{backupserver=\"$backupserver\"})", 812 | "interval": "", 813 | "legendFormat": "", 814 | "refId": "A" 815 | } 816 | ], 817 | "timeFrom": null, 818 | "timeShift": null, 819 | "title": "Files archived", 820 | "type": "stat" 821 | }, 822 | { 823 | "datasource": "${DS_PROMETHEUS}", 824 | "description": "Number of chunks in all repos", 825 | "fieldConfig": { 826 | "defaults": { 827 | "custom": {}, 828 | "decimals": 2, 829 | "mappings": [], 830 | "thresholds": { 831 | "mode": "absolute", 832 | "steps": [ 833 | { 834 | "color": "green", 835 | "value": null 836 | } 837 | ] 838 | }, 839 | "unit": "short" 840 | }, 841 | "overrides": [] 842 | }, 843 | "gridPos": { 844 | "h": 3, 845 | "w": 3, 846 | "x": 9, 847 | "y": 8 848 | }, 849 | "id": 7, 850 | "options": { 851 | "colorMode": "value", 852 | "graphMode": "area", 853 | "justifyMode": "auto", 854 | "orientation": "auto", 855 | "reduceOptions": { 856 | "calcs": [ 857 | "mean" 858 | ], 859 | "fields": "", 860 | "values": false 861 | }, 862 | "textMode": "auto" 863 | }, 864 | "pluginVersion": "7.3.3", 865 | "targets": [ 866 | { 867 | "expr": "sum(borg_chunks_total{backupserver=\"$backupserver\"})", 868 | "interval": "", 869 | "legendFormat": "", 870 | "refId": "A" 871 | } 872 | ], 873 | "timeFrom": null, 874 | "timeShift": null, 875 | "title": "Total chunks", 876 | "type": "stat" 877 | }, 878 | { 879 | "datasource": "${DS_PROMETHEUS}", 880 | "description": "Number of unique chunks in all repos", 881 | "fieldConfig": { 882 | "defaults": { 883 | "custom": {}, 884 | "decimals": 2, 885 | "mappings": [], 886 | "thresholds": { 887 | "mode": "absolute", 888 | "steps": [ 889 | { 890 | "color": "green", 891 | "value": null 892 | } 893 | ] 894 | }, 895 | "unit": "short" 896 | }, 897 | "overrides": [] 898 | }, 899 | "gridPos": { 900 | "h": 3, 901 | "w": 3, 902 | "x": 12, 903 | "y": 8 904 | }, 905 | "id": 8, 906 | "options": { 907 | "colorMode": "value", 908 | "graphMode": "area", 909 | "justifyMode": "auto", 910 | "orientation": "auto", 911 | "reduceOptions": { 912 | "calcs": [ 913 | "mean" 914 | ], 915 | "fields": "", 916 | "values": false 917 | }, 918 | "textMode": "auto" 919 | }, 920 | "pluginVersion": "7.3.3", 921 | "targets": [ 922 | { 923 | "expr": "sum(borg_chunks_unique{backupserver=\"$backupserver\"})", 924 | "interval": "", 925 | "legendFormat": "", 926 | "refId": "A" 927 | } 928 | ], 929 | "timeFrom": null, 930 | "timeShift": null, 931 | "title": "Unique chunks", 932 | "type": "stat" 933 | }, 934 | { 935 | "datasource": "${DS_PROMETHEUS}", 936 | "description": "Percentage of unique chunks", 937 | "fieldConfig": { 938 | "defaults": { 939 | "custom": {}, 940 | "decimals": 1, 941 | "mappings": [], 942 | "thresholds": { 943 | "mode": "absolute", 944 | "steps": [ 945 | { 946 | "color": "green", 947 | "value": null 948 | }, 949 | { 950 | "color": "#EAB839", 951 | "value": 30 952 | }, 953 | { 954 | "color": "dark-red", 955 | "value": 40 956 | } 957 | ] 958 | }, 959 | "unit": "percent" 960 | }, 961 | "overrides": [] 962 | }, 963 | "gridPos": { 964 | "h": 3, 965 | "w": 3, 966 | "x": 15, 967 | "y": 8 968 | }, 969 | "id": 9, 970 | "options": { 971 | "orientation": "auto", 972 | "reduceOptions": { 973 | "calcs": [ 974 | "mean" 975 | ], 976 | "fields": "", 977 | "values": false 978 | }, 979 | "showThresholdLabels": false, 980 | "showThresholdMarkers": true 981 | }, 982 | "pluginVersion": "7.3.3", 983 | "targets": [ 984 | { 985 | "expr": "sum(borg_chunks_unique{backupserver=\"$backupserver\"})/sum(borg_chunks_total{backupserver=\"$backupserver\"})*100", 986 | "interval": "", 987 | "legendFormat": "", 988 | "refId": "A" 989 | } 990 | ], 991 | "timeFrom": null, 992 | "timeShift": null, 993 | "title": "Unique chunk %", 994 | "type": "gauge" 995 | }, 996 | { 997 | "collapsed": false, 998 | "datasource": "${DS_PROMETHEUS}", 999 | "gridPos": { 1000 | "h": 1, 1001 | "w": 24, 1002 | "x": 0, 1003 | "y": 11 1004 | }, 1005 | "id": 29, 1006 | "panels": [], 1007 | "repeat": "host", 1008 | "title": "Backup details for $host", 1009 | "type": "row" 1010 | }, 1011 | { 1012 | "datasource": "${DS_PROMETHEUS}", 1013 | "description": "Number of archives in the selected repo", 1014 | "fieldConfig": { 1015 | "defaults": { 1016 | "custom": {}, 1017 | "mappings": [], 1018 | "thresholds": { 1019 | "mode": "absolute", 1020 | "steps": [ 1021 | { 1022 | "color": "green", 1023 | "value": null 1024 | } 1025 | ] 1026 | } 1027 | }, 1028 | "overrides": [] 1029 | }, 1030 | "gridPos": { 1031 | "h": 3, 1032 | "w": 3, 1033 | "x": 0, 1034 | "y": 12 1035 | }, 1036 | "id": 30, 1037 | "options": { 1038 | "colorMode": "value", 1039 | "graphMode": "area", 1040 | "justifyMode": "auto", 1041 | "orientation": "auto", 1042 | "reduceOptions": { 1043 | "calcs": [ 1044 | "mean" 1045 | ], 1046 | "fields": "", 1047 | "values": false 1048 | }, 1049 | "textMode": "auto" 1050 | }, 1051 | "pluginVersion": "7.3.3", 1052 | "targets": [ 1053 | { 1054 | "expr": "sum(borg_archives_count{backupserver=\"$backupserver\", host=\"$host\"})", 1055 | "interval": "", 1056 | "legendFormat": "", 1057 | "refId": "A" 1058 | } 1059 | ], 1060 | "timeFrom": null, 1061 | "timeShift": null, 1062 | "title": "Total archives", 1063 | "type": "stat" 1064 | }, 1065 | { 1066 | "datasource": "${DS_PROMETHEUS}", 1067 | "description": "Number of archives saved today", 1068 | "fieldConfig": { 1069 | "defaults": { 1070 | "custom": {}, 1071 | "mappings": [], 1072 | "thresholds": { 1073 | "mode": "absolute", 1074 | "steps": [ 1075 | { 1076 | "color": "dark-red", 1077 | "value": null 1078 | }, 1079 | { 1080 | "color": "#EAB839", 1081 | "value": 1 1082 | }, 1083 | { 1084 | "color": "dark-green", 1085 | "value": 2 1086 | } 1087 | ] 1088 | } 1089 | }, 1090 | "overrides": [] 1091 | }, 1092 | "gridPos": { 1093 | "h": 3, 1094 | "w": 3, 1095 | "x": 3, 1096 | "y": 12 1097 | }, 1098 | "id": 31, 1099 | "options": { 1100 | "colorMode": "value", 1101 | "graphMode": "area", 1102 | "justifyMode": "auto", 1103 | "orientation": "auto", 1104 | "reduceOptions": { 1105 | "calcs": [ 1106 | "mean" 1107 | ], 1108 | "fields": "", 1109 | "values": false 1110 | }, 1111 | "textMode": "auto" 1112 | }, 1113 | "pluginVersion": "7.3.3", 1114 | "targets": [ 1115 | { 1116 | "expr": "sum(borg_archives_count_today{backupserver=\"$backupserver\", host=\"$host\"})", 1117 | "interval": "", 1118 | "legendFormat": "", 1119 | "refId": "A" 1120 | } 1121 | ], 1122 | "timeFrom": null, 1123 | "timeShift": null, 1124 | "title": "Today archives", 1125 | "type": "stat" 1126 | }, 1127 | { 1128 | "datasource": "${DS_PROMETHEUS}", 1129 | "description": "Size of all the data, uncompressed", 1130 | "fieldConfig": { 1131 | "defaults": { 1132 | "custom": {}, 1133 | "decimals": 1, 1134 | "mappings": [], 1135 | "thresholds": { 1136 | "mode": "absolute", 1137 | "steps": [ 1138 | { 1139 | "color": "semi-dark-blue", 1140 | "value": null 1141 | } 1142 | ] 1143 | }, 1144 | "unit": "decbytes" 1145 | }, 1146 | "overrides": [] 1147 | }, 1148 | "gridPos": { 1149 | "h": 3, 1150 | "w": 4, 1151 | "x": 6, 1152 | "y": 12 1153 | }, 1154 | "id": 32, 1155 | "options": { 1156 | "colorMode": "value", 1157 | "graphMode": "area", 1158 | "justifyMode": "auto", 1159 | "orientation": "auto", 1160 | "reduceOptions": { 1161 | "calcs": [ 1162 | "mean" 1163 | ], 1164 | "fields": "", 1165 | "values": false 1166 | }, 1167 | "textMode": "auto" 1168 | }, 1169 | "pluginVersion": "7.3.3", 1170 | "targets": [ 1171 | { 1172 | "expr": "sum(borg_last_size{backupserver=\"$backupserver\", host=\"$host\"})", 1173 | "interval": "", 1174 | "legendFormat": "", 1175 | "refId": "A" 1176 | } 1177 | ], 1178 | "timeFrom": null, 1179 | "timeShift": null, 1180 | "title": "Uncompressed size", 1181 | "type": "stat" 1182 | }, 1183 | { 1184 | "datasource": "${DS_PROMETHEUS}", 1185 | "description": "Size of all the data, compressed", 1186 | "fieldConfig": { 1187 | "defaults": { 1188 | "custom": {}, 1189 | "decimals": 1, 1190 | "mappings": [], 1191 | "thresholds": { 1192 | "mode": "absolute", 1193 | "steps": [ 1194 | { 1195 | "color": "light-orange", 1196 | "value": null 1197 | } 1198 | ] 1199 | }, 1200 | "unit": "decbytes" 1201 | }, 1202 | "overrides": [] 1203 | }, 1204 | "gridPos": { 1205 | "h": 3, 1206 | "w": 4, 1207 | "x": 10, 1208 | "y": 12 1209 | }, 1210 | "id": 33, 1211 | "options": { 1212 | "colorMode": "value", 1213 | "graphMode": "area", 1214 | "justifyMode": "auto", 1215 | "orientation": "auto", 1216 | "reduceOptions": { 1217 | "calcs": [ 1218 | "mean" 1219 | ], 1220 | "fields": "", 1221 | "values": false 1222 | }, 1223 | "textMode": "auto" 1224 | }, 1225 | "pluginVersion": "7.3.3", 1226 | "targets": [ 1227 | { 1228 | "expr": "sum(borg_last_size_compressed{backupserver=\"$backupserver\", host=\"$host\"})", 1229 | "interval": "", 1230 | "legendFormat": "", 1231 | "refId": "A" 1232 | } 1233 | ], 1234 | "timeFrom": null, 1235 | "timeShift": null, 1236 | "title": "Compressed size", 1237 | "type": "stat" 1238 | }, 1239 | { 1240 | "datasource": "${DS_PROMETHEUS}", 1241 | "description": "Size of all the data, compressed and deduplicated", 1242 | "fieldConfig": { 1243 | "defaults": { 1244 | "custom": {}, 1245 | "decimals": 1, 1246 | "mappings": [], 1247 | "thresholds": { 1248 | "mode": "absolute", 1249 | "steps": [ 1250 | { 1251 | "color": "green", 1252 | "value": null 1253 | } 1254 | ] 1255 | }, 1256 | "unit": "decbytes" 1257 | }, 1258 | "overrides": [] 1259 | }, 1260 | "gridPos": { 1261 | "h": 3, 1262 | "w": 4, 1263 | "x": 14, 1264 | "y": 12 1265 | }, 1266 | "id": 34, 1267 | "options": { 1268 | "colorMode": "value", 1269 | "graphMode": "area", 1270 | "justifyMode": "auto", 1271 | "orientation": "auto", 1272 | "reduceOptions": { 1273 | "calcs": [ 1274 | "mean" 1275 | ], 1276 | "fields": "", 1277 | "values": false 1278 | }, 1279 | "textMode": "auto" 1280 | }, 1281 | "pluginVersion": "7.3.3", 1282 | "targets": [ 1283 | { 1284 | "expr": "sum(borg_last_size_dedup{backupserver=\"$backupserver\", host=\"$host\"})", 1285 | "interval": "", 1286 | "legendFormat": "", 1287 | "refId": "A" 1288 | } 1289 | ], 1290 | "timeFrom": null, 1291 | "timeShift": null, 1292 | "title": "Deduplicated size", 1293 | "type": "stat" 1294 | }, 1295 | { 1296 | "datasource": "${DS_PROMETHEUS}", 1297 | "description": "How much space you are saving with compression and deduplication", 1298 | "fieldConfig": { 1299 | "defaults": { 1300 | "custom": {}, 1301 | "decimals": 1, 1302 | "mappings": [], 1303 | "thresholds": { 1304 | "mode": "absolute", 1305 | "steps": [ 1306 | { 1307 | "color": "dark-red", 1308 | "value": null 1309 | }, 1310 | { 1311 | "color": "#EAB839", 1312 | "value": 70 1313 | }, 1314 | { 1315 | "color": "dark-green", 1316 | "value": 85 1317 | } 1318 | ] 1319 | }, 1320 | "unit": "percent" 1321 | }, 1322 | "overrides": [] 1323 | }, 1324 | "gridPos": { 1325 | "h": 3, 1326 | "w": 4, 1327 | "x": 18, 1328 | "y": 12 1329 | }, 1330 | "id": 35, 1331 | "options": { 1332 | "orientation": "auto", 1333 | "reduceOptions": { 1334 | "calcs": [ 1335 | "mean" 1336 | ], 1337 | "fields": "", 1338 | "values": false 1339 | }, 1340 | "showThresholdLabels": false, 1341 | "showThresholdMarkers": true 1342 | }, 1343 | "pluginVersion": "7.3.3", 1344 | "targets": [ 1345 | { 1346 | "expr": "100-sum(borg_last_size_dedup{backupserver=\"$backupserver\", host=\"$host\"})/sum(borg_last_size{backupserver=\"$backupserver\", host=\"$host\"})*100", 1347 | "interval": "", 1348 | "legendFormat": "", 1349 | "refId": "A" 1350 | } 1351 | ], 1352 | "timeFrom": null, 1353 | "timeShift": null, 1354 | "title": "Disk saving %", 1355 | "type": "gauge" 1356 | }, 1357 | { 1358 | "datasource": "${DS_PROMETHEUS}", 1359 | "description": "Breakdown per archive", 1360 | "fieldConfig": { 1361 | "defaults": { 1362 | "custom": {}, 1363 | "mappings": [], 1364 | "thresholds": { 1365 | "mode": "absolute", 1366 | "steps": [ 1367 | { 1368 | "color": "green", 1369 | "value": null 1370 | }, 1371 | { 1372 | "color": "#EAB839", 1373 | "value": 300000000 1374 | }, 1375 | { 1376 | "color": "red", 1377 | "value": 1000000000 1378 | } 1379 | ] 1380 | }, 1381 | "unit": "decbytes" 1382 | }, 1383 | "overrides": [] 1384 | }, 1385 | "gridPos": { 1386 | "h": 8, 1387 | "w": 12, 1388 | "x": 0, 1389 | "y": 15 1390 | }, 1391 | "id": 37, 1392 | "options": { 1393 | "displayMode": "lcd", 1394 | "orientation": "horizontal", 1395 | "reduceOptions": { 1396 | "calcs": [ 1397 | "mean" 1398 | ], 1399 | "fields": "", 1400 | "values": false 1401 | }, 1402 | "showUnfilled": true 1403 | }, 1404 | "pluginVersion": "7.3.3", 1405 | "targets": [ 1406 | { 1407 | "expr": "borg_last_size{backupserver=\"$backupserver\", host=\"$host\"}", 1408 | "interval": "", 1409 | "legendFormat": "{{archive}}", 1410 | "refId": "A" 1411 | } 1412 | ], 1413 | "timeFrom": null, 1414 | "timeShift": null, 1415 | "title": "Original sizes", 1416 | "transformations": [], 1417 | "type": "bargauge" 1418 | }, 1419 | { 1420 | "datasource": "${DS_PROMETHEUS}", 1421 | "description": "Breakdown per archive", 1422 | "fieldConfig": { 1423 | "defaults": { 1424 | "custom": {}, 1425 | "mappings": [], 1426 | "thresholds": { 1427 | "mode": "absolute", 1428 | "steps": [ 1429 | { 1430 | "color": "green", 1431 | "value": null 1432 | }, 1433 | { 1434 | "color": "#EAB839", 1435 | "value": 300000000 1436 | }, 1437 | { 1438 | "color": "red", 1439 | "value": 1000000000 1440 | } 1441 | ] 1442 | }, 1443 | "unit": "decbytes" 1444 | }, 1445 | "overrides": [] 1446 | }, 1447 | "gridPos": { 1448 | "h": 8, 1449 | "w": 12, 1450 | "x": 12, 1451 | "y": 15 1452 | }, 1453 | "id": 38, 1454 | "options": { 1455 | "displayMode": "lcd", 1456 | "orientation": "horizontal", 1457 | "reduceOptions": { 1458 | "calcs": [ 1459 | "mean" 1460 | ], 1461 | "fields": "", 1462 | "values": false 1463 | }, 1464 | "showUnfilled": true 1465 | }, 1466 | "pluginVersion": "7.3.3", 1467 | "targets": [ 1468 | { 1469 | "expr": "borg_last_size_dedup{backupserver=\"$backupserver\", host=\"$host\"}", 1470 | "interval": "", 1471 | "legendFormat": "{{archive}}", 1472 | "refId": "A" 1473 | } 1474 | ], 1475 | "timeFrom": null, 1476 | "timeShift": null, 1477 | "title": "Deduplicated sizes", 1478 | "transformations": [], 1479 | "type": "bargauge" 1480 | } 1481 | ], 1482 | "refresh": false, 1483 | "schemaVersion": 26, 1484 | "style": "dark", 1485 | "tags": [ 1486 | "backup", 1487 | "borg" 1488 | ], 1489 | "templating": { 1490 | "list": [ 1491 | { 1492 | "allValue": null, 1493 | "current": {}, 1494 | "datasource": "${DS_PROMETHEUS}", 1495 | "definition": "label_values(borg_archives_count, backupserver)", 1496 | "error": null, 1497 | "hide": 0, 1498 | "includeAll": false, 1499 | "label": "Backup server", 1500 | "multi": false, 1501 | "name": "backupserver", 1502 | "options": [], 1503 | "query": "label_values(borg_archives_count, backupserver)", 1504 | "refresh": 1, 1505 | "regex": "", 1506 | "skipUrlSync": false, 1507 | "sort": 0, 1508 | "tagValuesQuery": "", 1509 | "tags": [], 1510 | "tagsQuery": "", 1511 | "type": "query", 1512 | "useTags": false 1513 | }, 1514 | { 1515 | "allValue": null, 1516 | "current": {}, 1517 | "datasource": "${DS_PROMETHEUS}", 1518 | "definition": "label_values(borg_archives_count, host)", 1519 | "error": null, 1520 | "hide": 0, 1521 | "includeAll": false, 1522 | "label": "Host", 1523 | "multi": false, 1524 | "name": "host", 1525 | "options": [], 1526 | "query": "label_values(borg_archives_count, host)", 1527 | "refresh": 1, 1528 | "regex": "", 1529 | "skipUrlSync": false, 1530 | "sort": 0, 1531 | "tagValuesQuery": "", 1532 | "tags": [], 1533 | "tagsQuery": "", 1534 | "type": "query", 1535 | "useTags": false 1536 | } 1537 | ] 1538 | }, 1539 | "time": { 1540 | "from": "now-6h", 1541 | "to": "now" 1542 | }, 1543 | "timepicker": { 1544 | "refresh_intervals": [ 1545 | "30s", 1546 | "1m", 1547 | "5m", 1548 | "15m", 1549 | "30m", 1550 | "1h", 1551 | "2h", 1552 | "1d" 1553 | ] 1554 | }, 1555 | "timezone": "", 1556 | "title": "Borg Backup status", 1557 | "uid": "mo_dwZeMk", 1558 | "version": 5 1559 | } --------------------------------------------------------------------------------