Check NFS exports for hosts that don't resolve anymore

Post Reply
chris
Site Admin
Posts: 37
Joined: Mon Dec 09, 2019 6:55 pm

Check NFS exports for hosts that don't resolve anymore

Post by chris »

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
Post Reply