I was wondering if anyone had any 'already setup' scripts that can run basic reports on ESX through VI Powershell?
Thanks to all in advance. I'm not much of a scritping person, and if anyone has anything already going that is helpful would be much appreciated.
More info. In fact when i look at the script in PSPad or notepad, I do not see those weird characthers, but for some reason Powershell interprets like that.
If I do a search for "-" in the doc, it finds zero occurrences, although we know it's there.
I am using latest version of PSPad, Notepad.
I am running Vista SP2 with Powershell 1.0 and the VI Toolkit 1.5 for Windows. ESX is 3.5U4 with VC 2.5
I can confirm the problem is with PSPad/Notepad text editors and the handling or dashes and quotaion marks. The funny characters showup in Wordpad and are then edited. the script then runs fine using either 1.5 OR 4.0 CLI.
thanks for your help.I am editing the script up a bit and hopefully can post a nice consolidated one that accounts for all reporting (and can be scheduled).
I have updated this excellent script to do a bit more. I have utilized/modified the works of:
1. Ivo Beerens (started this wonderful script)
2. Ade Orimalade (Avge. Memory Usage)
3. esarakaitis @ vmwarescripting.com (check this site out if you have not already, and bookmark it)
4. Bill Scott (removal of style.css and embedding report into email (no need for attachement)
- Stylesheet settings to body so email can be sent HTML formatted
- Removed style references in every table addition
- Avge Daily and Memory Usage to VM Statistics (Thanks Ade Orimalade)
- NTP Servers (Thanks esarakaitis at www.vmwarescripting.com)
- Verify NTP Client running (Thanks esarakaitis at www.vmwarescripting.com)
- Service Console IPs (Thanks esarakaitis at www.vmwarescripting.com)
- List Virtual Switches (Thanks esarakaitis at www.vmwarescripting.com)
- List Virtual Switches Port Groups and Security (Thanks esarakaitis at www.vmwarescripting.com)
- Change Time Sync to see ENABLED guests since we sync with AD
- Added html file to body of email (Thanks Bill Scott)
Please see attached and let me know what you think.
I have run this manually and from schedule and it works fine.
Am having trouble getting the HealthCheck script to work. I am new to Powershell, but am familiar with VMware, and would like to produce some custom reports. I have PowerGUI installed, so am also just learning my way around that user interface for that.
I have one VirtualCenter server (VI3), with multiple Datacenters, with mutiple folders, with multiple clusters of hosts.
How can I get a list of virtual machines (either for whole datacenter, or for individual cluster etc) with VM details like, Name, Datastore location of disks, size of disks, PortGroups it belongs to, memory, NumCPUs, GuestOS, floppy drive attached, CD drive attached/connected, IP address, power state, VMware Tools status? Can someone help with the script for this - it would be a great help - either to run in the CLI, or as a report I can click on in PowerGUI?
Thanks in advance
If you are looking for PowerShell / VMware tools you might find the VESI better - it is directly aimed at Virtual platforms and is based on the same platform as PowerGUI. They released version 1.2 a week ago and has some Best Practice features now which are very good for morning reports.
Alan Renouf just released version 3 of this Daily Report which also has a ton of useful checks ...[http://www.virtu-al.net/2009/11/04/vcheck-daily-report-v3/] and he released a lot of his scripts in a PowerPack for PowerGUI / VESI the other day.
You should be able to build what you need by viewing the code of the script packs and tweaking them to what you want.
Thanks for the reply and the links mattroblin, but the problem is I don't know how to "tweak" the scripts unfortunately...
The VESI interface looks cool, and that DailyCheck script would appear to give a lot of useful information (perhaps too much).... (It took me about an hour just to work out how to kick the script off, and then after about two hours of running I cancelled it - because it appears to run on the entire VC, instead of promting for a folder or Cluster)
The VESI gives some basic reports that could be helpful, but would be great if it were possible to custom select some extra columns, so that when it reports on Virtual Machines, it reports all the info the you would find if you went to VirtualCenter, right-clicked on the VM, and Edit Settings... Things like which Network Adapter it is connected to; VMware Tools Status; Boot Delay etc Is there any way to add these particular fields for reporting, or is the only way to get something scripted - because that would be a showstopper for me...
In general, you can get datastores for a given cluster by passing the output of Get-Cluster to Get-VMHost then to Get-Datastore. That doesn't give you anything pretty, but may get you part way there. For some more interesting data, look at this script
apologies for accidentally resurrecting this old thread -- my browser didn't render the second page of the thread