getHostHardwareHealthInfo.pl for vCenter / ESX / ESXi

Version 8

    Table of Contents

    • Author

    • Description

    • Category

    • Features

    • Requirements

    • Version Support

    • Sample Execution

    • Sample Output

    • Email Reports

     

    Author

    William Lam

     

    Description

    This scripts allows you to monitor the host hardware Health Status located on the configuration tab under Hardware section of an ESX(i) host. The script will look at all available components health such as CPU,MEMORY,STORAGE,CHASSIS,etc. to ensure everything is operating at normal status. If there are any warnings and/or errors on any of the components, the script will generate output for each component for a given host and color highlight based on the severity of issue. If the system is in good health, you will get an ALL OK status in the report.

     

    Further more, you can execute this against individual ESX or ESXi (free and licensed versions supported) host or vCenter to monitor some or all of your hosts. This is great for users starting out with ESXi and would like to do some monitoring on the hardware.

     

    Category

    • Health Monitoring

     

    Features

    • Supports vCenter and ESX and ESXi (licensed and free version)

    • Supports running on both Windows and Linux

    • Supports emailing capablities for report

     

    Requirements

    • vCenter 2.5 or 4.0

    • ESX(i) 3.5 or 4.0

    • vSphere SDK for Perl/vCLI 4.0 Windows or Linux OR vMA 4.0

     

    Version Support

    • Supports ESX(i) hosts being managed by vCenter

    • Supports both ESX and ESXi (licensed and free version)

     

    Sample Execution

    If you execute the script against a vCenter host, you have the option of monitoring a subset of ESX(i) hosts or all hosts. To monitor all hosts you'll need to specify --monitortype to be all, if you only want to monitor subset then you need to specify some and you also need to provide a input file that lists the FQDN of the hosts to be monitored seperated by a newline

     

    Monitor all hosts within a vCenter (executed on vMA):

    [vi-admin@scofield skunkworks]$ ./getHostHardwareHealthInfo.pl --server reflex.primp-industries.com --username primp --monitortype all
    Enter password:
    
    Generating VMware Host Hardware Health Report "vmwareHostHardwareHealthReport.html" ...
    

     

     

    Monitor subset of hosts within a vCenter (executed on vMA):

    [vi-admin@scofield skunkworks]$ ./getHostHardwareHealthInfo.pl --server reflex.primp-industries.com --username primp --monitortype some --hostfile primp-hosts
    Enter password:
    
    Generating VMware Host Hardware Health Report "vmwareHostHardwareHealthReport.html" ...
    

     

     

    Monitor individual ESX(i) host (executed on vMA):

    [vi-admin@scofield skunkworks]$ ./getHostHardwareHealthInfo.pl --server esx4-1.primp-industries.com --username root
    Enter password:
    
    Generating VMware Host Hardware Health Report "vmwareHostHardwareHealthReport.html" ...
    

     

     

    Monitor individual ESX(i) host (executed on Windows Vista):

    C:\Users\stylez\Desktop>getHostHardwareHealthInfo.pl --server esxi4-2.primp-industries.com --username root
    Enter password:
    
    Generating VMware Host Hardware Health Report "vmwareHostHardwareHealthReport.html" ...
    

     

     

    Note: With individual host, you do not need to specify any additional parameters other than server name

     

    Sample Output

    Good Output

     

    Bad Output

     

     

     

    Emailing Reports

    If you would like have the report to be executed and emailed out on specified internal you can setup a scheduled task via Windows Task Manager or Linux cron and you'll need to edit the script to enable email functionality.

     

    If you open the script with your favorite editor, at the very top you'll find the following:

    my $SEND_MAIL = "no";
    my $EMAIL_HOST = "emailserver";
    my $EMAIL_DOMAIN = "localhost.localdomain";
    my $EMAIL_TO = 'William Lam <william@primp-industries.com>';
    my $EMAIL_FROM = 'vMA <vMA@primp-industries.com>';
    

     

     

    You'll need to modify the variables to your environment and you can test it by running the script and you should get the report emailed to you.