3 # Copyright (C) 2000-2016 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Bacula interface to tapeinfo to get tape alerts
8 # tapealert %l (control device name)
10 # Note: you must have in your SD Device resource:
11 # Alert Command = /full-path/tapealert %l
12 # Control Device = /dev/sg0n (where this is the scsi control
13 # device for the device you are using).
17 # 1. uncomment out the DEBUG=1 line below
18 # 2. Possibly remove or add TapeAlert[nn]: that you want to test.
19 # Note, the message following the : is not used.
24 tapeinfo=`which tapeinfo`
26 if [ x${tapeinfo} = x ] ; then
27 echo "tapeinfo program not found, but is required."
31 echo "First argument missing. Must be device control name."
36 if [ x$DEBUG = x ] ; then
37 $tapeinfo -f $1 |grep "^TapeAlert" - |cut -b1-13
43 cat <<EOF |grep "^TapeAlert" - |cut -b1-13
44 Product Type: Tape Drive
46 Product ID: 'ULTRIUM-TD6 '
48 Attached Changer API: No
49 SerialNumber: 'F3A2930090'
50 TapeAlert[3]: Hard Error: Uncorrectable read/write error.
51 TapeAlert[5]: Read Failure: Tape faulty or tape drive broken.
52 TapeAlert[39]: Undefined.
64 DataDeCompEnabled: yes