<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><span id="mailbox-conversation"><div>I have this script work is failing on all hosts except the first one. </div>
<div><br></div>
<div>I have narrowed it down to the ssh statement. For some reason the ssh statement causes the script to exit after the first host. </div>
<div><br></div>
<div>Any ideas why the ssh statement would cause the ext script to exit after the first host ?</div>
<div><br></div>
<div><br></div>
<div><br></div>
<div>
<div>#!/bin/sh</div>
<div><br></div>
<div><br></div>
<div>export PATH=$PATH:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/local/bin</div>
<div><br></div>
<div><br></div>
<div>HOSTTAG=zfsmon          # What we put in hosts.cfg to trigger this test</div>
<div><br></div>
<div>COLUMN=zfs              # Name of the column, often same as tag in hosts.cfg</div>
<div><br></div>
<div><br></div>
<div>$XYMONHOME/bin/xymongrep $HOSTTAG | while read L</div>
<div><br></div>
<div>do</div>
<div><br></div>
<div>        set $L  # To get one line of output from xymongrep</div>
<div><br></div>
<div><br></div>
<div>        HOSTIP="$1"</div>
<div><br></div>
<div>        MACHINEDOTS="$2"</div>
<div><br></div>
<div>        MACHINE=`echo $2 | $SED -e's/\./,/g'`</div>
<div><br></div>
<div><br></div>
<div>        COLOR=green</div>
<div><br></div>
<div>        MSG="&green $MACHINEDOTS : POOL OK "</div>
<div><br></div>
<div><br></div>
<div>        #... do the test, perhaps modify COLOR and MSG</div>
<div><br></div>
<div><br></div>
<div>        typeset ZFSSTAT=</div>
<div><br></div>
<div><br></div>
<div>        ZFSHEALTH=`/usr/local/bin/ssh $MACHINE "/sbin/zpool get health rpool" | grep ONLINE | wc -l`</div>
<div><br></div>
<div><br></div>
<div>        if [ $ZFSHEALTH -ne 1 ]</div>
<div><br></div>
<div>        then</div>
<div><br></div>
<div>        COLOR=red</div>
<div><br></div>
<div>        MSG="&red $MACHINEDOTS : POOL ISSUE"</div>
<div><br></div>
<div>        fi</div>
<div><br></div>
<div><br></div>
<div>        ZFSSTAT=`ssh -q $MACHINE /sbin/zpool status rpool`</div>
<div><br></div>
<div><br></div>
<div>        $XYMON $XYMSRV "status $MACHINE.$COLUMN $COLOR `date`</div>
<div><br></div>
<div><br></div>
<div>        ${MSG}</div>
<div><br></div>
<div><br></div>
<div>        $ZFSSTAT</div>
<div><br></div>
<div>      "</div>
<div><br></div>
<div>Done</div>
</div>
<div><br></div>
<div><br></div></span></body></html>