<br><tt><font size=2>Hi</font></tt><br><br><tt><font size=2>> I can exclude CIFS using df options to avoid
the hang, but then I won't<br>> get any warning at all unless I find a better way to check the mounts.
<br>> Suggestions?<br>I have written an SMB test for Hobbit a few years ago, maybe this is what
you are looking for.</font></tt><br><tt><font size=2>It writes a small file to a CIFS share, reads it and
then deletes it using the smbclient program.</font></tt><br><br><tt><font size=2>Thorsten</font></tt><br><br><br><tt><font size=2>#!/bin/sh</font></tt><br><tt><font size=2>##########################################################################################</font></tt><br><tt><font size=2>#  Hier geschieht der eigentliche Samba Test</font></tt><br><tt><font size=2>##########################################################################################</font></tt><br><tt><font size=2>SmbTest ( ) {</font></tt><br><tt><font size=2>  echo "Samba test on $MACHINE" >$TEMPFILE</font></tt><br><tt><font size=2>  grep -i $MACHINE $BBHOME/etc/smb.ini | while
read mach user passw share</font></tt><br><tt><font size=2>  do</font></tt><br><tt><font size=2>    if [ "$mach" <> "#"
]</font></tt><br><tt><font size=2>    then</font></tt><br><tt><font size=2>    echo "This is a hobbit testfile
and should be here only temporarely" >${TEMPFILE}1.txt</font></tt><br><tt><font size=2>    error=`smbclient //$mach/$share -U $user
$passw 2>&1 <<EOF</font></tt><br><tt><font size=2>put ${TEMPFILE}1.txt testfile.txt</font></tt><br><tt><font size=2>get testfile.txt ${TEMPFILE}2.txt</font></tt><br><tt><font size=2>quit</font></tt><br><tt><font size=2>EOF`</font></tt><br><tt><font size=2>    echo "$error" | grep -i "ERR"
>/dev/null</font></tt><br><tt><font size=2>    if [ $? -ne 0 ]</font></tt><br><tt><font size=2>    then</font></tt><br><tt><font size=2>      echo "&green Samba test
on //$mach/$share is ok"  >>$TEMPFILE</font></tt><br><tt><font size=2>    else</font></tt><br><tt><font size=2>      echo "&red Samba test
on //$mach/$share failed" >>$TEMPFILE</font></tt><br><tt><font size=2>      echo "$error" >>$TEMPFILE</font></tt><br><tt><font size=2>    fi</font></tt><br><tt><font size=2>    rm  ${TEMPFILE}1.txt ${TEMPFILE}2.txt
>/dev/null 2>&1</font></tt><br><tt><font size=2>fi</font></tt><br><tt><font size=2>  done</font></tt><br><tt><font size=2>  grep "&red" $TEMPFILE  >/dev/null</font></tt><br><tt><font size=2>  if [ $? -eq 0 ]</font></tt><br><tt><font size=2>  then</font></tt><br><tt><font size=2>    COLOR=red</font></tt><br><tt><font size=2>  fi</font></tt><br><tt><font size=2>  return 0</font></tt><br><tt><font size=2>}</font></tt><br><br><tt><font size=2>##########################################################################################</font></tt><br><tt><font size=2>#</font></tt><br><tt><font size=2>#  Hier beginnt das Hauptprogramm</font></tt><br><tt><font size=2>#</font></tt><br><tt><font size=2>##########################################################################################</font></tt><br><br><tt><font size=2>DEBUG=FALSE</font></tt><br><tt><font size=2>if [ "$1." = "--debug." ]</font></tt><br><tt><font size=2>then</font></tt><br><tt><font size=2>   DEBUG=TRUE</font></tt><br><tt><font size=2>   BBHOME=..</font></tt><br><tt><font size=2>   . $BBHOME/etc/hobbitserver.cfg</font></tt><br><tt><font size=2>   echo "Debugmode"</font></tt><br><tt><font size=2>fi</font></tt><br><br><tt><font size=2>BBHTAG=smb      # What we put in bb-hosts
to trigger this test</font></tt><br><tt><font size=2>COLUMN=$BBHTAG  # Name of the column, often same
as tag in bb-hosts</font></tt><br><br><tt><font size=2>TEMPFILE=$BBTMP/$BBHTAG.output.tmp</font></tt><br><br><tt><font size=2>$BBHOME/bin/bbhostgrep $BBHTAG | while read L</font></tt><br><tt><font size=2>do</font></tt><br><tt><font size=2>  rm $TEMPFILE >/dev/null 2>&1</font></tt><br><tt><font size=2>  set $L        # To get
one line of output from bbhostgrep</font></tt><br><br><tt><font size=2>  HOSTIP="$1"</font></tt><br><tt><font size=2>  MACHINEDOTS="$2"</font></tt><br><tt><font size=2>  MACHINE=`echo $2 | $SED -e's/\./,/g'`</font></tt><br><br><tt><font size=2>  COLOR=green</font></tt><br><tt><font size=2>  echo "Samba Test on $MACHINEDOTS"
> $TEMPFILE</font></tt><br><tt><font size=2>  SmbTest $2</font></tt><br><tt><font size=2>  MSG=`cat $TEMPFILE`</font></tt><br><br><tt><font size=2>  if [ $DEBUG = TRUE ]</font></tt><br><tt><font size=2>  then</font></tt><br><tt><font size=2>    echo "status $MACHINE.$COLUMN $COLOR
`date` $MSG"</font></tt><br><tt><font size=2>  else</font></tt><br><tt><font size=2>    $BB $BBDISP "status $MACHINE.$COLUMN
$COLOR `date` $MSG"</font></tt><br><tt><font size=2>  fi</font></tt><br><tt><font size=2>  rm $TEMPFILE >/dev/null 2>&1</font></tt><br><tt><font size=2>done</font></tt><br><br><tt><font size=2>exit 0</font></tt><br><br><br><tt><font size=2>smb.ini:</font></tt><br><br><tt><font size=2>#</font></tt><br><tt><font size=2># Config file for the smb fileserver test (smb)</font></tt><br><tt><font size=2># for each fileshare which should be tested we need
a line giving the servername and a sharename including testfile</font></tt><br><tt><font size=2>#</font></tt><br><tt><font size=2># Host     User      Passw
    Sharename</font></tt><br><tt><font size=2>hostname   userID    Password  my_share
     # this will test \\hostname\myshare with UserID "userID"
and password "Password"</font></tt><br><br><font face="sans-serif"><font face="sans-serif, Arial, Helvetica" size="-1" color="#808080"><br>If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
<br></br> 
                                                                          
</font></font>