Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 5 '11 at 17:14
    
@DerfK I want to obtain everything 'status director' returns and format a nice webpage from it. –  Hardex Apr 7 '11 at 5:13
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.