Hi
I would like to ask about my plan script
I have this several workstation want to monitor and execute a command without logging it we use "rsh $host "<command>" i create csh script using foreach to loop my several workstation, my problem with the rsh command is if it encounter a workstation that is being down or move therefore no connection the rsh cmd stop or even not continue. here my initial script and my problem:
#!/usr/bin/csh -f
foreach host(host1 host2 host.....)
ping -t 30 $host 5 > /dev/null
set status = ( I want the return value of the ping to be the "status" variable )
if( status == 0 ) then
rsh $host " uname -a"
else
echo " ---$host unavailable---"
endif
echo " ----- END -----"
sleep 1
end
Any suggestion would be greatly appreciated,
thanks in advance