26 Sep 2011

vCheck – VMware vSphere monitoring and reporting

Posted by Jonas

If you’re not already running some sort of monitoring tool or script on your VMware vSphere environment may I suggest you get acquainted with vCheck. Reader, meet vCheck. vCheck, reader :)

Alan Renouf (Working for VMware in Technical Marketing and PowerCLI guru | @alanrenouf on Twitter) has programmed vCheck – a script that can list a whole lot of valuable information about your vSphere environment and present it in a nicely formatted html file that can be delivered by mail in your inbox every morning.

Among other things the script shows various VM statistics including (maybe forgotten) snapshots, free space of datastores, missing VMTools . Alerts and errors are listed separately.

Setup information and example report all at:
vCheck (Daily Report)
http://www.virtu-al.net/featured-scripts/vcheck/

Link to Example report:
http://virtu-al.net/Downloads/vCheck/vCenter01vCheck_26-3-2010.htm

Note one of the prerequisites is PowerCLI 4.0 U1 or later (on the server running the script)
To show the current version of PowerCLI run:
Get-PowerCLIVersion

NB: I’ve had a ton of problems initially setting this up as a scheduled task.. It turns out the a scheduled task cannot run a script on a mapped drive (for example P:\vCheck5\vCheck5.ps1), so make sure to use a UNC path when pointing to the script if it’s not located on the server being configured with the scheduled task!

The following works like a charm*

 Use the Action: Start a program
 Program/script: powershell
 Add arguments: -c "\\server\share\vCheck5.ps1 vcenterserver"

* Please note I’ve used method 1 explained here:
Running a PowerCLI Scheduled task
http://www.virtu-al.net/2009/07/10/running-a-powercli-scheduled-task/ and added add-pssnapin VMware.VimAutomation.Core to the beginning of the file (below the param( [string] $VISRV) line), in order to get the PowerCLI cmdlets loaded into the PowerShell session.

The running of the script takes a few minutes (depending of the size of your environment). At work with 11 hosts and 6x VM’s it takes 7 minutes to complete.

When viewing the result e-mail in Outlook, make sure to view the file in an external browser (as a .mth file) – my Outlook 2010 doesn’t show the headlines for each section which makes the rapport quite difficult to read.

Categories: It

Leave a Reply

Message:

:) :( :o :? 8) :D :x :P :wink: