Jean-Francois,

Maybe it's an incompatibility with the sed command,
could you try the attached patch?

If it still doesn't work, could you send me the chg-zd-mtx.<timestamps>.debug file.

Jean-Louis

Jean-Francois Malouin wrote:
Hello,

Just testing 2.5.1p2-20070202 and looking at the ChangeLog I see that
some mods have been made concerning the detection of IMPORT/EXPORT
slots in the glue script chg-zd-mtx which I think break things up,
viz:

yorick::# su amanda -c "/opt/amanda/amanda10/sbin/amcheck -t stk_180-conf10"
Amanda Tape Server Host Check
-----------------------------
Changer problem: no slots available
changer problem: no slots available       (expecting tape
stk_180-conf10-000029 or a new tape)
Server check took 3.158 seconds

(brought to you by Amanda 2.5.1p2-20070202)

Tape stk_180-conf10-000029 is in the library and available.
If I use chg-zd-mtx from amanda-2.5.1p1 amcheck detects and load
the tape correctly.

mtx version 1.2.16rel is installed and its status ouput from a STK-L180
library looks like:

  Storage Changer /dev/changer-l180:2 Drives, 184 Slots ( 10 Import/Export )
Data Transfer Element 0:Full (Storage Element 93 Loaded):VolumeTag = R00005 Data Transfer Element 1:Empty Storage Element 1:Full :VolumeTag=Q00510 Storage Element 2:Full :VolumeTag=Q00511 Storage Element 3:Full :VolumeTag=Q00512 Storage Element 4:Full :VolumeTag=Q00513 [...] Storage Element 174:Full :VolumeTag=Q00500 Storage Element 175 IMPORT/EXPORT:Empty
      Storage Element 176 IMPORT/EXPORT:Empty
      Storage Element 177 IMPORT/EXPORT:Empty
      Storage Element 178 IMPORT/EXPORT:Empty
      Storage Element 179 IMPORT/EXPORT:Empty
      Storage Element 180 IMPORT/EXPORT:Empty
      Storage Element 181 IMPORT/EXPORT:Empty
      Storage Element 182 IMPORT/EXPORT:Empty
      Storage Element 183 IMPORT/EXPORT:Empty
      Storage Element 184 IMPORT/EXPORT:Empty

regards,
jf


diff -u -r --show-c-function --new-file --exclude-from=/home/martinea/src.orig/amanda.diff --ignore-matching-lines='$Id:' amanda-2.5.1p2.new/changer-src/chg-zd-mtx.sh.in amanda-2.5.1p2.new.chg-zd-mtx/changer-src/chg-zd-mtx.sh.in
--- amanda-2.5.1p2.new/changer-src/chg-zd-mtx.sh.in	2007-02-01 14:25:57.000000000 -0500
+++ amanda-2.5.1p2.new.chg-zd-mtx/changer-src/chg-zd-mtx.sh.in	2007-02-05 07:31:52.000000000 -0500
@@ -495,12 +495,20 @@ get_loaded_info() {
 	if [ $loadedslot -eq -2 ]; then
 		set x `sed -n '
 {
-    /^.*Storage Element '$currentslot'\( IMPORT\/EXPORT\)\?:Empty/ {
-	s/.*Storage Element \([0-9][0-9]*\)\( IMPORT\/EXPORT\)\?:Empty/\1/p
+    /^.*Storage Element '$currentslot':Empty/ {
+	s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
+        q
+    }
+    /^.*Storage Element '$currentslot':Full/ {
+	s/.*Storage Element \([0-9][0-9]*\):Full/-2/p
+        q
+    }
+    /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Empty/ {
+	s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p
         q
     }
-    /^.*Storage Element '$currentslot'\( IMPORT\/EXPORT\)\?:Full/ {
-	s/.*Storage Element \([0-9][0-9]*\)\( IMPORT\/EXPORT\)\?:Full/-2/p
+    /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Full/ {
+	s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/-2/p
         q
     }
 }
@@ -516,8 +524,12 @@ get_loaded_info() {
 	if [ $loadedslot -eq -2 ]; then
 		set x `sed -n '
 {
-    /^.*Storage Element \([0-9][0-9]*\)\( IMPORT\/EXPORT\)\?:Empty/ {
-	s/.*Storage Element \([0-9][0-9]*\)\( IMPORT\/EXPORT\)\?:Empty/\1/p
+    /^.*Storage Element \([0-9][0-9]*\):Empty/ {
+	s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
+        q
+    }
+    /^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/ {
+	s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p
         q
     }
 }
@@ -569,8 +581,11 @@ get_slot_list() {
 	s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
     }
 }
-/^.*Storage Element \([0-9][0-9]*\)\( IMPORT\/EXPORT\)\?:Full/ {
-    s/.*Storage Element \([0-9][0-9]*\)\( IMPORT\/EXPORT\)\?:Full.*/\1/p
+/^.*Storage Element \([0-9][0-9]*\):Full/ {
+    s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p
+}
+/^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/ {
+    s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full.*/\1/p
 }
 ' < $mtx_status 2>&1 | grep -v "^${cleanslot}\$" | sort -n`
 	slot_list=`echo $slot_list`		# remove the newlines

Reply via email to