I recently posted here that I had written a Xymon script to monitor Bacula.
The script basically uses the bconsole program to run a "status dir" followed by a "list jobs", like so: echo "status dir" | /usr/sbin/bconsole (do some grepping etc) followed by echo "list jobs" | /usr/sbin/bconsole (do some grepping etc) Since I currently have all of my storage unmounted, I expected to come in this morning to find an alert on my Xymon server telling me there was "...a job waiting on storage..." or "...a mount request..." etc However, this was not the case. Upon researching, I can see that from a shell prompt, when I run: # echo "status dir " | bconsole -c /etc/bacula/include/my-bconsole.conf <enter> bconsole connects to the Bacula director, sends the "status dir" command and starts to output what I expect, like so: Connecting to Director ClientB:9101 1000 OK: ClientB-dir Version: 5.0.2 (28 April 2010) Enter a period to cancel a command. status dir ClientB-dir Version: 5.0.2 (28 April 2010) x86_64-pc-linux-gnu gentoo and the output STOPS right there.... Until I hit ANY key, at which point the rest of the output of the "status dir" command instantly completes like so: Daemon started 07-Jul-10 14:05, 82 Jobs run since started. Heap: heap=843,776 smbytes=265,593 max_bytes=570,891 bufs=879 max_bufs=1,531 Scheduled Jobs: Level Type Pri Scheduled Name Volume =================================================================================== Incremental Backup 10 21-Jul-10 20:30 ClientA_Full OffsiteFileTape_D3_VOL0037 Incremental Backup 10 21-Jul-10 20:30 ClientB_Full OffsiteFileTape_D3_VOL0037 Incremental Backup 10 21-Jul-10 20:30 ClientB_Music OffsiteFileTape_D3_VOL0037 Full Backup 10 22-Jul-10 03:15 Email_Server OffsiteFileTape_D4_VOL0065 Full Backup 10 22-Jul-10 03:15 Helpdesk_Server OffsiteFileTape_D4_VOL0065 Full Backup 11 22-Jul-10 03:15 BackupCatalog OffsiteFileTape_D4_VOL0065 ==== Running Jobs: Console connected at 21-Jul-10 06:26 Console connected at 21-Jul-10 06:50 JobId Level Name Status ====================================================================== 5461 Increme ClientA_Full.2010-07-20_20.30.00_50 is waiting for a mount request 5462 Increme ClientB_Full.2010-07-20_20.30.01_51 is running 5463 Increme VlientB_Music.2010-07-20_20.30.01_52 is waiting on max Client jobs 5464 Full Email_Server.2010-07-21_03.15.00_53 is running 5465 Full Helpdesk_Server.2010-07-21_03.15.00_54 is running 5466 Full BackupCatalog.2010-07-21_03.15.00_55 is waiting for higher priority jobs to finish ==== Terminated Jobs: JobId Level Files Bytes Status Finished Name ==================================================================== 5450 Full 329 36.94 G OK 19-Jul-10 07:21 VMs 5452 Full 199,692 2.647 G OK 19-Jul-10 08:27 Email_Server 5451 Full 9,830 56.00 G OK 19-Jul-10 09:38 ClientB_Music 5454 Full 8 3.213 G OK 19-Jul-10 09:57 BackupCatalog 5455 Incr 2,072 863.7 M OK 19-Jul-10 20:39 ClientA_Full 5456 Incr 446 2.141 G OK 19-Jul-10 20:45 ClientB_Full 5457 Incr 0 0 OK 19-Jul-10 20:45 ClientB_Music 5459 Full 43,450 695.2 M OK 20-Jul-10 03:57 Helpdesk_Server 5458 Full 199,896 2.651 G OK 20-Jul-10 06:01 Email_Server 5460 Full 8 3.226 G OK 20-Jul-10 06:14 BackupCatalog ==== You have messages. ...and I am back at the shell prompt. The same is currently true for any other command piped to bconsole. If I start bconsole and run those two commands (or any commands) from the bconsole "*" prompt, I get the desired output. So my questions are: - Why is bconsole blocking, and waiting for a key press when commands are piped to it? - And does the situation where all of my storage is currently unmounted play any part? I guess I can determine this once I am able to remount my disk storage, after I am done dd'ing /dev/urandom to it, but that will be in several hours. All ideas are welcome. :) -- Bill Arlofski Reverse Polarity, LLC ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users