ronmanu07
Enthusiast
Enthusiast

Reporting through Powershell

Hi All,

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.

Cheers.

0 Kudos
31 Replies
LucD
Leadership
Leadership

Which of the Healthcheck scripts did you use ?

There are several in this thread.

Could you perhaps attach your script ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
pvjsingh
Contributor
Contributor

Please see attached. Which one in your opinion is the most up to date?

http://www.ttgapers.com
0 Kudos
pvjsingh
Contributor
Contributor

Hi,

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

Thanks,

http://www.ttgapers.com
0 Kudos
LucD
Leadership
Leadership

I would advise you to upgrade to the latest version, PowerCLI v4.

I ran the script you attached in a VC2.5/ESX 3.5u4 environment without a problem.

But I ran it with PowerCLI v4.

And I ran it from the PowerCLI prompt.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
pvjsingh
Contributor
Contributor

Hi,

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).

Jason

http://www.ttgapers.com
0 Kudos
pvjsingh
Contributor
Contributor

Hi,

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)

Changes are:

  1. - Stylesheet settings to body so email can be sent HTML formatted

  2. - Removed style references in every table addition

  3. - Avge Daily and Memory Usage to VM Statistics (Thanks Ade Orimalade)

  4. - NTP Servers (Thanks esarakaitis at www.vmwarescripting.com)

  5. - Verify NTP Client running (Thanks esarakaitis at www.vmwarescripting.com)

  6. - Service Console IPs (Thanks esarakaitis at www.vmwarescripting.com)

  7. - List Virtual Switches (Thanks esarakaitis at www.vmwarescripting.com)

  8. - List Virtual Switches Port Groups and Security (Thanks esarakaitis at www.vmwarescripting.com)

  9. - Change Time Sync to see ENABLED guests since we sync with AD

  10. - 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.

Thanks,

Jason

http://www.ttgapers.com

http://www.ttgapers.com
0 Kudos
FirstByte
Enthusiast
Enthusiast

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

Darren

0 Kudos
mattroblin
Contributor
Contributor

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.

Matt Roblin VCP3/4 'Fix the problem, not the blame.'
0 Kudos
FirstByte
Enthusiast
Enthusiast

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...

Thanks

0 Kudos
DougBaer
VMware Employee
VMware Employee

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

http://www.peetersonline.nl/index.php/vmware/check-vmware-configuration-with-powershell/

Cheers,

Doug

    • apologies for accidentally resurrecting this old thread -- my browser didn't render the second page of the thread Smiley Sad

Doug Baer, Staff Architect, Sr. Manager of vPod Architecture team for the VMware Hands-on Labs | VCDX #019, vExpert 2012-20 | @dobaer
0 Kudos
ronmanu07
Enthusiast
Enthusiast

Thank you so much everyone for your input/suggestions very much appreciated. Some very great ideas here.

Cheers.

0 Kudos
AlbertWT
Virtuoso
Virtuoso

Wow, this is a great script, thanks for sharing it here man.

Kind Regards,

AWT

/* Any kind of comment or input would be greatly appreciated */
0 Kudos