VMware ESX healthcheck

One of the most useful scripts for ESX in my opinion is health_check.sh. This scripts generates an html file which contains a enormous amount of useful info on how the ESX host was installed. Besides that it contains 30 lines of the most important log files and for instance if there are snapshots and much much more. I just tested the script on ESX 3.5 and it still works great. The script is created by two guys of the Danish VMUG one of them is A. Mikkelsen, check his blog for more scripts! Be sure to check out this script, it’s worth it! By the way, you can schedule it and have the html emailed to you via the use of smtp_send.pl.

16 Responses to “ VMware ESX healthcheck ”

  1. Hi,
    And thanks very much for the nice comment.
    If anyone have feature requests to the script please let me know.

    A. Mikkelsen

  2. Yes, VERY useful script. I have tested it on ESX 3.0.x and also ESX 3.5 and is working great.
    I did have problem setting it up in crontab. Have tried various settings but when I put it in crontab nothing happens. In crontab log it seams that script executed but no file is creater / mail send. Any ideas?

    Thanx

  3. that’s because the path to the config file is missing. edit the script and put the config path in there the hard way.

  4. Great looking script. Would be nice to see if it could dump it to a csv. Have not looked to see if it can do that yet, but it would be very nice as I manage over 400 ESX servers right now. It would be nice it have it dump a csv on a scheduled basis. That way I could pull it up in a central report view.

  5. Doesn’t support csv at the moment… But just request the feature on the forum of sourceforge and maybe, if these guys can find the time, they will hook you up.

  6. Just put it in there!

    Thanks!

  7. Just ran on two servers within our ESX farm. One running 3.5 and the other running 3.0.2. Both worked great! Going to work on getting it scheduled daily.

  8. “Duncan Epping
    January 28th, 2008 at 18:44

    that’s because the path to the config file is missing. edit the script and put the config path in there the hard way.”

    Yes, you are right. After hardcode .conf file the script runs perfectly in crontab.
    The only problem is now that it dont send emails. Probably enviroment problem?

  9. probably the same issue? hard coded path?

  10. I am having no problem getting the html generated but the email part is not working…I get the following:

    smartHost: smtp.intra.net
    to: gballard@dcolighting.com
    subject: ESX Healthcheck VM1.intra.net
    attach: /var/log/esx_healthcheck_30-01-08.html
    Failed to connect to mail server: Invalid argument
    at /health/smtp_send.pl line 114

    And line 114 in the smtp_send.pl is:

    $msg->send;

    Any ideas?

  11. Did you open up port 25 on the ESX firewall?

  12. According to esxcfg-firewall -q:

    Opened ports:
    smtp_out : port 25 tcp.out

    Yes it appears that it is open.

  13. “Duncan Epping
    January 30th, 2008 at 20:11

    probably the same issue? hard coded path?”

    Correct, I had to hardcode path also for smtp_send.pl and now is working ;-)

    Thank you for your help!

  14. Regarding the script to generate csv files instead of html i will look into this asap, but my test enviroment has crached and i’m waiting for a new disk.
    I hope to get it within days and then i look into it.
    Hope you can wait :-)

  15. Got my test enviroment up and running.
    I looked a bit on how to generate a CSV file and i need some idears.
    1. Do you want 2 colums (description, data)?
    Or give me an idear to how you would like it to look.
    You can email it to me at (am”’_@_ ”’ amikkelsen.com)
    2. Do you want a header/title for each colum?

    Any idears are welcome - any code are also apprecited

  16. Just another ‘attaboy’ for the script. I too hardcoded the paths for health_check.conf in the sh

    . /usr/local/bin/health_check.conf

    and

    for smtp_send.pl in the conf

    /usr/local/bin/smtp_send.pl

    and it is working great as a cron job

    thanks!!

Leave a Reply