• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

VMware ESX healthcheck

Duncan Epping · Jan 28, 2008 ·

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.

Related

Management & Automation, Server 3.0.x, 3.5, ESX, Scripting, service console

Reader Interactions

Comments

  1. A. Mikkelsen says

    28 January, 2008 at 14:01

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

    A. Mikkelsen

  2. kastro says

    28 January, 2008 at 17:47

    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. Duncan Epping says

    28 January, 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.

  4. Clint Eschberger says

    28 January, 2008 at 20:28

    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. Duncan Epping says

    28 January, 2008 at 20:42

    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. Clint Eschberger says

    28 January, 2008 at 21:29

    Just put it in there!

    Thanks!

  7. Luis R. Alvarez says

    29 January, 2008 at 23:06

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

    30 January, 2008 at 14:00

    “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. Duncan Epping says

    30 January, 2008 at 20:11

    probably the same issue? hard coded path?

  10. Grant Ballard says

    30 January, 2008 at 21:48

    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. Duncan Epping says

    30 January, 2008 at 21:52

    Did you open up port 25 on the ESX firewall?

  12. Grant Ballard says

    30 January, 2008 at 22:07

    According to esxcfg-firewall -q:

    Opened ports:
    smtp_out : port 25 tcp.out

    Yes it appears that it is open.

  13. kastro says

    2 February, 2008 at 11:25

    “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. A. Mikkelsen says

    3 February, 2008 at 18:49

    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. A. Mikkelsen says

    4 February, 2008 at 22:18

    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. Jim Warren says

    3 March, 2008 at 17: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!!

  17. jatdesi says

    30 July, 2008 at 22:27

    Thanks for a very helpful post AND blog!

  18. Anders Olsson says

    26 September, 2008 at 10:35

    Hi. Looks great, but why is there no development on the SF project?

  19. Daniel Larsson says

    29 October, 2008 at 11:49

    Is there a ESXi compatible script?

    //Daniel

  20. Duncan Epping says

    29 October, 2008 at 11:54

    Not yet, but the guys are working on it, they are probably going to leverage Powershell…

  21. Daniel Larsson says

    29 October, 2008 at 14:12

    It Would have been nice to use VMware’s RCLI appliance

  22. Simon says

    14 July, 2009 at 17:05

    Thanks so much for this really useful script

    • Leatrice says

      2 July, 2011 at 19:53

      This article achieved exatcly what I wanted it to achieve.

  23. MarkC says

    11 August, 2009 at 10:48

    The script is great and had been running fine until I removed some datastores now it errors when running and doesn’t complete. Any idea what could be wrong?

    [2009-08-11 09:53:45 ‘StorageInfo’ warning] Skipping lun: vmhba1:0:21. SysinfoEx ception: Node (VSI_NODE_storage_scsi_adapter_channel_target_lun_partition) ; Status(bad003f)= No connection; Message= Unable to Get Instance List

  24. Chris says

    8 March, 2010 at 20:18

    I’m having the same issue as MarkC. Anyone find an answer for this one? The new rev 49 does the same error spit.

    [root@sunvh01 healthchk]# /usr/local/bin/healthchk/health_check.sh
    : bad interpreter: No such file or directory.sh: /bin/sh
    [root@sunvh01 healthchk]# sh /usr/local/bin/healthchk/health_check.sh
    : command not foundthchk/health_check.sh: line 20:
    : No such file or directoryalth_check.sh: line 21: cd: /usr/local/bin/healthchk
    : command not foundthchk/health_check.sh: line 26:
    : command not foundthchk/health_check.sh: line 35:
    : command not foundthchk/health_check.sh: line 39:
    : command not foundthchk/health_check.sh: line 44:
    rm: cannot lstat `/var/log/*.html\r’: No such file or directory
    : command not foundthchk/health_check.sh: line 46:
    : command not foundthchk/health_check.sh: line 48:
    /usr/local/bin/healthchk/health_check.sh: line 49: syntax error near unexpected ‘oken `{
    ‘usr/local/bin/healthchk/health_check.sh: line 49: `printhtmlstart() {

  25. Skdhunna says

    19 July, 2010 at 10:10

    hi,

    to over come this issue,
    [root@sunvh01 healthchk]# /usr/local/bin/healthchk/health_check.sh
    : bad interpreter: No such file or directory.sh: /bin/sh

    please try this.

    simple Perl command always seems to clear up the problem. Try the following command on your text file then try and run it.

    perl -i -pe’s/\r$//;’

    is “health_check.sh” please try without quotes.

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in