Check NFS exports for hosts that don't resolve anymore
Posted: Tue Dec 10, 2019 10:00 am
Code: Select all
for myzone in `isi zone list | grep ifs |awk '{print$1}'`
do echo "=========================================" $myzone
for export_id in `isi nfs exports list --zone=$myzone | grep $myzone | awk '{print$1}'`
do echo -n "========= export ID: " $export_id " "
isi nfs exports view --zone=$myzone --id=$export_id | grep "Paths:"
for clients in `isi nfs exports view --zone=$myzone --id=$export_id | grep -i client | grep -v "-" | sed -e "s/Read Only Clients: //g" | sed -e "s/Read Write Clients: //g"| sed -e "s/Root Clients: //g" | sed -e "s/Clients: //g" | sed -e "s/,/ /g"`
do if [[ "$clients" =~ [A-Za-z] ]]; then
echo "==" $clients
nslookup $clients | grep -i --color can\'t
else
echo "==" $clients " is an IP or subnet"
fi
done
done
done