On 11/10/26 9:13 PM, Rob Gerber wrote:
Robert,

Bill attached his tape test script to his first email. Perhaps your email service blocked the email because it contained a script. I have renamed the script to not end in .sh, packed it in a password protected zip (password: bacula), and have re- attached it here. Please let me know if you receive it.

Thanks for helping out Robert(Gerber)! :)


Regarding the tapealert script, it provides essential information about errors reported by the tape drive. Things like "need cleaning' or 'tape broken!'. Because you do not have a changer (which can monitor and report some of those things), I think you especially could benefit from this upgraded script.

Yeah, the Bacula SD has some nice, somewhat hidden, features built around the original `tapealert` script that has been shipping with Bacula since the beginning.

When an `AlertCommand` and a `ControlDevice` are configured in a Bacula SD Device's configuration, the SD calls this script at the end of an operation and I believe also at the end of a job.

The script prints out any drive alert codes to stdout when it is called, then, the SD logs these codes and some text about what each means to the job log - and depending on the type and criticality of the code(s), the SD can disable a drive device, disable a volume, and more.

For example, when a drive requires cleaning *immediately* as in the snippet below, both the device and the volume that was in it at the time were disabled, and the SD failed the job (that should get someone's attention! :)
----8<----
27-Oct 10:05 ol9-sd JobId 240228: Warning: Disabled Device "waa_a-Autochanger_Dev0" (/dev/tape/by-id/scsi-350223344ab001700-nst) due to tape alert=20.

27-Oct 10:05 ol9-sd JobId 240228: Warning: Disabled Volume "G05001TA" due to 
tape alert=20.

27-Oct 10:05 ol9-sd JobId 240228: Fatal error: Alert: Volume="G05001TA" alert=20: ERR=The tape drive needs cleaning: The drive thinks it has a head clog, or needs cleaning.
1. If the operation has stopped, eject the tape and clean the drive.
2. If the operation has not stopped, wait for it to finish and then clean the 
drive.
Check the tape drive users manual for device specific cleaning instructions.
----8<----

My replacement tapealert script performs the exact same functions as the original, but because it can auto-detect the /dev/sg# device you shouldn't run into a situation where your tapealert checks are no longer working because the drive's SG node changed after a reboot - and you don't know they are not working.

Also, it does some nice logging, and can even send an email when tape alerts are found. Plus, it could use some real-world testing. :)


Best regards,
Bill

--
Bill Arlofski
[email protected]

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to