Bareos (Backup Archive REcovery Open Sourced) is an enterprise-grade open source backup solution forked from Bacula in 2010. When you run Bareos to protect your infrastructure, you're operating a multi-daemon system: the Director orchestrates all jobs, the Storage Daemon writes to backup volumes, File Daemons run on every protected client, and a PostgreSQL or MySQL catalog tracks all job metadata. A silent Director crash, a full volume pool, or a File Daemon that stopped responding can leave critical servers unprotected without any visible failure in your operations dashboard. Vigilmon provides continuous monitoring across every Bareos component so you know before your RTO is breached.
What You'll Set Up
- Bareos Director health monitor via bconsole connectivity
- Backup job success rate monitoring via cron heartbeat
- Backup job duration anomaly detection
- Storage Daemon health monitor
- Catalog database connectivity monitor
- Volume pool usage and capacity alert
- Last successful backup age alert per client
- File Daemon reachability monitor
- Restore job success rate heartbeat
- Bareos WebUI HTTP health check
Prerequisites
- Bareos Director, Storage Daemon, and File Daemons installed and running
- bconsole configured and accessible on the Director host
- Bareos WebUI accessible via HTTP/HTTPS (default port 80/443)
- Catalog database running (PostgreSQL or MySQL)
- A free Vigilmon account
Step 1: Monitor the Bareos Director Health
The Bareos Director is the central orchestrator — all backup schedules, restore jobs, and verification tasks flow through it. A Director crash halts every scheduled job until it is restarted.
Create a bconsole-based heartbeat that confirms the Director is accepting connections and responding to status queries:
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
Heartbeat / Cron. - Name:
Bareos Director Health. - Heartbeat interval:
5 minutes(alert if no heartbeat for 10 minutes). - Copy the heartbeat URL.
Director check script on your Bareos host:
#!/bin/bash
# /usr/local/bin/check-bareos-director.sh
HEARTBEAT_URL="https://hb.vigilmon.online/your-director-heartbeat-id"
# Send 'status director' to bconsole and check for expected output
result=$(echo "status director" | bconsole -c /etc/bareos/bconsole.conf 2>&1)
if echo "$result" | grep -q "Daemon started"; then
curl -s "$HEARTBEAT_URL" > /dev/null
else
echo "Bareos Director not responding: $result"
exit 1
fi
Add to cron:
*/5 * * * * /usr/local/bin/check-bareos-director.sh
Step 2: Monitor Backup Job Success Rate
Failed backup jobs are the primary risk event in any Bareos deployment. Check the catalog for recent job failures and post a Vigilmon heartbeat only when all critical jobs have completed successfully.
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos Backup Job Success. - Heartbeat interval:
1 hour(alert if no heartbeat for 2 hours). - Copy the heartbeat URL.
Job success check script:
#!/bin/bash
# /usr/local/bin/check-bareos-jobs.sh
HEARTBEAT_URL="https://hb.vigilmon.online/your-jobs-heartbeat-id"
DB_NAME="bareos"
DB_USER="bareos"
# Count failed jobs in the last 24 hours
failed_count=$(psql -U "$DB_USER" -d "$DB_NAME" -t -c \
"SELECT COUNT(*) FROM job WHERE jobstatus IN ('E','f') AND starttime > NOW() - INTERVAL '24 hours';")
failed_count=$(echo "$failed_count" | tr -d ' ')
if [ "$failed_count" -gt 0 ]; then
echo "$failed_count backup job(s) failed in the last 24 hours"
exit 1
fi
curl -s "$HEARTBEAT_URL" > /dev/null
For per-job alerting on specific critical backup jobs, create separate heartbeat monitors and filter the catalog query by job.name.
Step 3: Monitor Backup Job Duration
A backup job running significantly longer than its historical baseline often signals unexpected file system growth, network congestion between the Director and Storage Daemon, or a File Daemon sending data slowly. Detect anomalies by comparing the current job duration against the 7-day average.
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos Job Duration Check. - Heartbeat interval:
1 hour.
Duration check script:
#!/bin/bash
HEARTBEAT_URL="https://hb.vigilmon.online/your-duration-heartbeat-id"
JOB_NAME="DailyBackup" # replace with your job name
MULTIPLIER=2 # alert if current duration > 2x average
avg_secs=$(psql -U bareos -d bareos -t -c \
"SELECT COALESCE(AVG(EXTRACT(EPOCH FROM (endtime - starttime))),0)
FROM job WHERE name='${JOB_NAME}' AND jobstatus='T'
AND endtime > NOW() - INTERVAL '7 days';" | tr -d ' ')
last_secs=$(psql -U bareos -d bareos -t -c \
"SELECT COALESCE(EXTRACT(EPOCH FROM (endtime - starttime)),0)
FROM job WHERE name='${JOB_NAME}' AND jobstatus='T'
ORDER BY endtime DESC LIMIT 1;" | tr -d ' ')
threshold=$(echo "$avg_secs * $MULTIPLIER" | bc)
if (( $(echo "$last_secs > $threshold && $avg_secs > 0" | bc -l) )); then
echo "Job ${JOB_NAME} took ${last_secs}s vs avg ${avg_secs}s (threshold: ${threshold}s)"
exit 1
fi
curl -s "$HEARTBEAT_URL" > /dev/null
Step 4: Monitor the Storage Daemon Health
The Bareos Storage Daemon manages all backup volume I/O. If the Storage Daemon process crashes, backup data cannot be written to or read from any volume.
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos Storage Daemon Health. - Heartbeat interval:
5 minutes.
Check script:
#!/bin/bash
HEARTBEAT_URL="https://hb.vigilmon.online/your-sd-heartbeat-id"
if ! pgrep -x bareos-sd > /dev/null; then
echo "bareos-sd process not running"
exit 1
fi
# Optionally test volume write via bconsole 'status storage'
result=$(echo "status storage" | bconsole -c /etc/bareos/bconsole.conf 2>&1)
if ! echo "$result" | grep -q "Daemon started"; then
echo "Storage Daemon not responding to bconsole: $result"
exit 1
fi
curl -s "$HEARTBEAT_URL" > /dev/null
Step 5: Monitor the Catalog Database
The Bareos catalog (PostgreSQL or MySQL) stores all job metadata, file records, and volume information. If the catalog is unreachable, the Director cannot schedule new jobs or track job completion.
For PostgreSQL:
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos Catalog DB Health. - Heartbeat interval:
2 minutes.
#!/bin/bash
HEARTBEAT_URL="https://hb.vigilmon.online/your-catalog-heartbeat-id"
result=$(psql -U bareos -d bareos -c "SELECT 1;" 2>&1)
if echo "$result" | grep -q "1 row"; then
curl -s "$HEARTBEAT_URL" > /dev/null
else
echo "Bareos catalog DB unreachable: $result"
exit 1
fi
For MySQL/MariaDB:
result=$(mysql -u bareos -p"$(cat /etc/bareos/.dbpassword)" bareos -e "SELECT 1;" 2>&1)
Step 6: Monitor Volume Pool Usage and Capacity
Bareos backup volumes fill over time. When a volume pool has no writable volumes remaining, the Director cannot start new backup jobs and will queue them until a volume is recycled or added.
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos Volume Pool Capacity. - Heartbeat interval:
15 minutes.
#!/bin/bash
HEARTBEAT_URL="https://hb.vigilmon.online/your-volume-heartbeat-id"
POOL_NAME="Full" # replace with your pool name
WARN_THRESHOLD=85 # alert when pool is 85% full
# Count volumes available vs total in pool
total=$(psql -U bareos -d bareos -t -c \
"SELECT COUNT(*) FROM media m JOIN pool p ON m.poolid=p.poolid WHERE p.name='${POOL_NAME}';" | tr -d ' ')
full=$(psql -U bareos -d bareos -t -c \
"SELECT COUNT(*) FROM media m JOIN pool p ON m.poolid=p.poolid \
WHERE p.name='${POOL_NAME}' AND m.volstatus IN ('Full','Used','Error');" | tr -d ' ')
if [ "$total" -gt 0 ]; then
pct=$(echo "scale=0; $full * 100 / $total" | bc)
if [ "$pct" -gt "$WARN_THRESHOLD" ]; then
echo "Pool ${POOL_NAME} is ${pct}% full (${full}/${total} volumes not writable)"
exit 1
fi
fi
curl -s "$HEARTBEAT_URL" > /dev/null
Step 7: Monitor Last Successful Backup Age
For each critical client, alert if the most recent successful backup is older than your RPO. This catches clients where the backup schedule silently stopped running.
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos Last Backup Age - <ClientName>. - Heartbeat interval:
1 hour.
#!/bin/bash
CLIENT_NAME="db-server-fd" # Bareos client name
RPO_HOURS=26 # alert if backup older than 26h
HEARTBEAT_URL="https://hb.vigilmon.online/your-rpo-heartbeat-id"
last_backup=$(psql -U bareos -d bareos -t -c \
"SELECT MAX(endtime) FROM job j JOIN client c ON j.clientid=c.clientid \
WHERE c.name='${CLIENT_NAME}' AND j.jobstatus='T' AND j.type='B';" | tr -d ' ')
if [ -z "$last_backup" ] || [ "$last_backup" = "" ]; then
echo "No successful backup found for client ${CLIENT_NAME}"
exit 1
fi
age_hours=$(psql -U bareos -d bareos -t -c \
"SELECT EXTRACT(EPOCH FROM (NOW() - '${last_backup}'::timestamp))/3600;" | tr -d ' ' | cut -d. -f1)
if [ "$age_hours" -gt "$RPO_HOURS" ]; then
echo "Last backup for ${CLIENT_NAME} is ${age_hours}h old (RPO: ${RPO_HOURS}h)"
exit 1
fi
curl -s "$HEARTBEAT_URL" > /dev/null
Create one monitor per critical client.
Step 8: Monitor File Daemon Connectivity
Each Bareos File Daemon (bareos-fd) runs on a protected client. If the File Daemon is unreachable from the Director, that client's backup jobs will fail the next time they are scheduled. Use bconsole's status client to probe connectivity:
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos FD Connectivity - <ClientName>. - Heartbeat interval:
15 minutes.
#!/bin/bash
CLIENT_NAME="db-server-fd"
HEARTBEAT_URL="https://hb.vigilmon.online/your-fd-heartbeat-id"
result=$(echo "status client=${CLIENT_NAME}" | bconsole -c /etc/bareos/bconsole.conf 2>&1)
if echo "$result" | grep -q "Daemon started\|Running Jobs"; then
curl -s "$HEARTBEAT_URL" > /dev/null
else
echo "File Daemon ${CLIENT_NAME} not responding: $result"
exit 1
fi
Step 9: Monitor Restore Job Success Rate
Periodic restore tests verify that your backups are actually recoverable. Alert when restore verification jobs fail:
- Click Add Monitor → Heartbeat / Cron.
- Name:
Bareos Restore Verification. - Heartbeat interval:
24 hours(post heartbeat after each scheduled verify run).
#!/bin/bash
HEARTBEAT_URL="https://hb.vigilmon.online/your-restore-heartbeat-id"
# Check for failed restore jobs in the last 24 hours
failed=$(psql -U bareos -d bareos -t -c \
"SELECT COUNT(*) FROM job WHERE type='R' AND jobstatus IN ('E','f') \
AND starttime > NOW() - INTERVAL '24 hours';" | tr -d ' ')
if [ "$failed" -gt 0 ]; then
echo "${failed} restore job(s) failed in the last 24 hours"
exit 1
fi
curl -s "$HEARTBEAT_URL" > /dev/null
Step 10: Monitor the Bareos WebUI
The Bareos WebUI provides operators with a browser-based interface for managing jobs and viewing status. An unavailable WebUI doesn't stop backups from running, but it leaves operators without visibility.
- Click Add Monitor → HTTP / HTTPS.
- URL:
https://bareos.yourdomain.com/bareos-webui/(or the HTTP URL if you haven't set up TLS). - Check interval:
2 minutes. - Expected HTTP status:
200. - Click Save.
Configuring Alerts
Configure alert channels to route Bareos failures to the right responders:
- In Vigilmon, go to Alert Channels and add your preferred destination (email, Slack, PagerDuty, webhook).
- Assign channels to each monitor under Settings → Alerting.
Recommended thresholds:
| Monitor | Alert Condition | Severity | |---|---|---| | Director health | Any failure | Critical | | Backup job success | Any failure in 24h | Critical | | Storage Daemon | Process not running | Critical | | Catalog DB | Unreachable | Critical | | Last backup age | Older than RPO | Critical | | File Daemon | Any failure | High | | Volume pool | > 85% full | Warning | | Job duration | > 2x baseline | Warning | | WebUI health | HTTP not 200 | Low |
Conclusion
Bareos protects your infrastructure — but only if you know when it stops working. With Vigilmon monitoring the Director, Storage Daemon, catalog database, File Daemons, volume pool capacity, and backup age against your RPO, you'll catch every Bareos failure before it becomes a recovery crisis.
Get started at vigilmon.online.