Catalog Virtual Machines
This script is useful if you want to keep an eye on new machines. I had a customer that couldn’t keep track of who was creating machines and the datastores filling up all the time. You don’t want full datastores!!!
[root@esx007 root]# cat catalog_servers.sh
#!/bin/sh
date > /root/catalog_servers.txt
echo ——————– >> /root/catalog_servers.txt
echo Virtualised Servers and Datastores >> /root/catalog_servers.txt
echo ——————– >> /root/catalog_servers.txt
ls -1F /vmfs/volumes/ | grep @ | cut -d @ -f 1 | while read dir; do
find /vmfs/volumes/${dir}/ -name “*.vmx” | grep -v “.snapshot” | cut -c 15-100 | cut -d / -f 1,2 >> /root/catalog_servers.txt
done
echo ——————– >> /root/catalog_servers.txt
echo “Free Space | Percentage Free | Volume” >> /root/catalog_servers.txt
echo ——————– >> /root/catalog_servers.txt
/usr/sbin/vdf -h | grep volumes | grep -v local | grep -v “-” | cut -c 34-40,41-44,59-100 >> /root/catalog_servers.txt









































