How to create a Backup Unit Report (status subscriptions)?

Overview

If you have (or want) a service contract for Bareos, the Backup Unit Report can help you keep track of the subscriptions in use. It will compute how many Bareos backup units are needed including optional component like database, virtual machine and filer units.
This article describes how to generate a Backup Unit Report and what do do with it.

Bareos WebUI (Bareos >= 22)

Create a Backup Unit Report by login to you local Bareos WebUI and navigate to Director -> Subscription. This will show you the output of the status subscriptions command. You can than click on the button "Download Backup Unit Report (JSON)" to download the report in JSON format (filename: bareos-backup-unit-report.json).
Alternatively you can download it directly via the URL
https://<YOUR_BAREOS_WEBUI_SERVER>/bareos-webui/director/backupunitreport
However, a login is still required. Also the WebUI user must have the permission to see all clients.

Bconsole (Bareos >= 21)

The bconsole command status subscription can be used to estimate subscription units.  See detailed usage on documentation page.
To generate a file report subscription-report.txt from the bconsole you can apply the following procedure:
bconsole <<< "@out /var/tmp/subscriptions-report.txt
status subscriptions detail
status subscriptions unknown
"

Script (Bareos < 21)

For any previous version, the usage of a dedicated tool called status-subscription.sh is needed. Please do only use it, when running Bareos version < 21.

The status-subscription.sh script will create two views into the database and will add several queries inside the configured query file of your Bareos Director.
You can get the tool with the following procedure:

Download the script to your Bareos director, make it executable, and run it as root.
(extended privileges are needed to be able to add the required queries to /usr/lib/bareos/script/query.sql file)

curl -O /var/tmp/status-subscription.sh https://support.bareos.com/tools/status-subscription.sh
chmod 750 /var/tmp/status-subscription.sh
sudo /var/tmp/status-subscription.sh
The report file will be generated as file /var/tmp/subscriptions-report.txt.

Configured Backup Units

The number of configured subscriptions is controlled by the Subscriptions configuration directive. It is only used for information purposes.

Contact your Bareos Sales Representative

The report generated with both approaches is identical (at least very similar).
Transfer the resulting report file (bareos-backup-unit-report.json or /var/tmp/subscriptions-report.txt) as email attachment to your Bareos representative (your Bareos partner or sales@bareos.com if you have ordered directly from the Bareos company).