Is it possible to obtain the status of Bacula Director in some parseable format? It looks like the human-readable representation (one you can see when using bacula-console) is formed on the director side during the TCP control connection.
Asked
Active
Viewed 374 times
1
-
What exactly are you looking for in this? I get quite a lot of different things from the status command for director: runtime, memory usage, # jobs run, and lists of scheduled, running, and terminated jobs. – DerfK Apr 05 '11 at 17:14
-
@DerfK I want to obtain *everything* 'status director' returns and format a nice webpage from it. – Eugene Pankov Apr 07 '11 at 05:13
1 Answers
1
I've just written a bash scripty thing to poll the bacula client status, and write the tape write speed (in GB/hr) to a logfile, along with a datestamp:
Here's how.
while `/bin/true`;
do
echo -n `date +%s` >> /var/log/backupspeed.log;
echo -n " " >> /var/log/backupspeed.log;
BPS=$(echo "status client"|bconsole|awk '/Bytes\/sec/ {print $3}'|cut -d'=' -f2|sed 's/,//g');
echo "scale=10;($BPS/(1024^3))*(60^2)"|bc >> /var/log/backupspeed.log;
sleep 10;
echo `date +%s`;
done
This is just what I threw together, to scratch my own itch, but it's pretty versatile.. You can pretty much just squirt stuff at bconsole, and parse the output.

Tom O'Connor
- 27,480
- 10
- 73
- 148