h2hummer47
Technical User
My 'else' isn't working. I only want entire lines containing 'error' for servers with Veritas loaded. Where there are no error status when running vxdisk list it should print the comment. Help...
#!/bin/ksh
touch vxdisk_check && chmod 777 vxdisk_check
echo "Veritas Disk Failure Report"
echo "As of:" `date`
echo ""
echo ""
for host in `cat /home/dtalley/scripts/vxdisklist`
do
echo $host
rsh $host /usr/sbin/vxdisk list |
nawk
'{
if($0~/error/) print $0}
else {print "All is good"}
fi
}'
done
#!/bin/ksh
touch vxdisk_check && chmod 777 vxdisk_check
echo "Veritas Disk Failure Report"
echo "As of:" `date`
echo ""
echo ""
for host in `cat /home/dtalley/scripts/vxdisklist`
do
echo $host
rsh $host /usr/sbin/vxdisk list |
nawk
'{
if($0~/error/) print $0}
else {print "All is good"}
fi
}'
done