WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

How to Send vCenter Alarm Notification to Growl

08.14.2011 by William Lam // 2 Comments

This tweet from Jason Nash and @PunchingClouds says it all and here it is!

I did some research this afternoon and stumbled upon this article Nagios: Notifications via Growl and leveraging the Net::Growl Perl module, I was able to forward alarms generated from a vCenter server to a system that was running Growl.

Software Requirements:

  • Growl for Windows or Mac OSX installed on a system to receive notifications
  • vSphere SDK for Perl installed on vCenter Server

Step 1 -  Install Grow and configure a password under the "Security" tab and ensure you "Allow network notification"

Step 2 - Install vSphere SDK for Perl on your vCenter server. You may also need to update the PATH variable with Perl bin directory (e.g. C:\Program Files\VMware\VMware vSphere CLI\Perl\bin)

Step 3 - Install Net::Growl Perl module using ppm (Perl Package Manager) which is part of ActiveState Perl with the installation of vSphere SDK for Perl. This will require your vCenter server have internet access to ActiveState Perl site, if you can not get this access, you can install this locally on your system and extract the Growl.pm and copy it to your vCenter server C:\Program Files\VMware\VMware vSphere CLI\Perl\site\lib\Net

Step 4 - Copy the Perl script from here and store it somewhere on your vCenter server, make sure it has the .pl extension. In this example, I named it growl.pl

Step 5 - To verify that Growl Perl script works and can communicate to the system with Growl install, you can manually test it by running the following command:

growl.pl -H william.primp-industries.com -p vmware -a custom -t Alert -m "hello william" -s 1

You will need to change -H to the hostname or IP Address of the system with Growl installed and of course the password you had setup. You should see a notification of the message you had just sent.

Step 6 - Create a batch script which will call the growl.pl script and store it somewhere on your vCenter server. Here is what the script (sendGrowl.bat) looks like, you can modify it to fit your requirements.

:: http://www.virtuallyghetto.com/
:: Custom vCenter Alarm script to generate growl notifications

set GROWL_SERVER=william.primp-industries.com
set GROWL_PASSWORD=vmware
set GROWL_SCRIPT_PATH="C:\Documents and Settings\primp.PRIMP-IND\Desktop\growl.pl"
set PATH="%PATH%;C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\site\bin"

%GROWL_SCRIPT_PATH% -H %GROWL_SERVER% -p %GROWL_PASSWORD% -a %COMPUTERNAME% -t Alert -m "%VMWARE_ALARM_EVENTDESCRIPTION%" -s 1

Note: If you would like to get a list of other default VMware alarm variables, run the "SET" command and output it to a file to get more details on various variables that can be accessed.

Step 7 - Create a new or update an existing vCenter alarm and under "Actions", specify "Run a command" option and provide the full path to the sendGrowl.bat

Step 8 - For testing purposes, I created a new alarm that would trigger upon an ESX(i) host going in/out of maintenance mode and you can see from the "Tasks and Events", our script is triggered on the vCenter server

and now for the finale, you should see a notification from Growl on your system and since we enable the "sticky" parameter, the notification will stay on your screen until you click on it. You can see that in the script example, I set the message to the event and application is registered as the name of the vCenter server, which allows you to have multiple vCenter forward you notifications.

So there you have it, forwarding vCenter alarms to Growl.

Note: Once a vCenter alarm has been triggered, the script will not fire off again until the original alarm has been reset to green. This behavior probably is okay for majority of the events one would want to monitor, but if you want it to continuously alert you, you will need to fiddle with a way to reset the alarm on the vCenter server.

UPDATE:  Thanks to Richard Cardona for reminding me, but this can also be implemented on the new VCVA (vCenter Server Virtual Appliance) in vSphere 5. Here are the instructions on setting it up

Step 1 - Install Grow and configure a password under the "Security" tab and ensure you "Allow network notification" on the system that is receiving the Growl notifications

Step 2 - To install Net::Growl, we'll be using cpan which requires 2 modules that are not installed by default on the SLES VCVA. Using the Tips and Tricks for vMA 5 (running SLES as well), we'll go ahead and setup zypper package manager for VCVA to install the two required packages: make and yaml

zypper --gpg-auto-import-keys ar http://download.opensuse.org/distribution/11.1/repo/oss/ 11.1
zypper --gpg-auto-import-keys ar http://download.opensuse.org/update/11.1/ Update-11.1
zypper refresh
zypper in make
zypper in perl-YAML

Step 3 - You will use cpan to install Net::Growl

perl -MCPAN -e shell

Step 4 - Once you are inside the cpan shell, type the following to install Net::Growl

install Net::Growl

Step 5 - Copy the Perl script from here and store it somewhere on your vCenter server (e.g. /root), make sure it has the .pl extension and has execute permission. In this example, I named it growl.pl

Step 6 - To verify that Growl Perl script works and can communicate to the system with Growl install, you can manually test it by running the following command:

vcenter50-2:~ # ./growl.pl -H william.primp-industries.com -p vmware -a custom -t Alert -m "hello william" -s 1

Step 7 - Create a shell script which will call the growl.pl script and store it somewhere on your vCenter server (e.g. /root). Here is what the script (sendGrowl.sh) looks like, you can modify it to fit your requirements.

Step 8 - Create a new or update an existing vCenter alarm and under "Actions", specify "Run a command" option and provide the full path to the sendGrowl.sh

Categories // Uncategorized Tags // alarm, api, growl, VCSA, vcva, vSphere 4.1, vSphere 5.0, vsphere sdk for perl

vGhetto VMworld 2011 Charity Bike Ride

08.13.2011 by William Lam // 1 Comment

Continuing the tradition of the VMworld Fun Run started by Duncan Epping back in 2010, VMworld 2011 will include both a fun run and new this year, a bike ride run in Las Vegas. This year, the VMworld 2011 Red Rock Canyon Bike Ride and Fun Run event will not only be for recreation but will also be for charity! The bike ride will be 23 miles and the fun run will be approximately an hour and distance will vary based on your speed. Also the event will be starting at 5am on Monday 29th, so make sure you recover from the VMworld Underground party the night before. 

The registration fee for the fun run is $110 USD and bike ride is $150 USD, which in my personal opinion is quite steep. I still think the event is worthwhile and this will be a great way to get some exercise, especially since I won't be able to ride my road bike as I normally do throughout the week. If you are attending VMworld 2011 in Las Vegas, you should consider taking part in this event for a great cause. All proceeds and registrations will be donated to the Friends of Red Rock Canyon, a group of volunteers who help to preserve the Red Rock Canyon in Nevada.

Okay, so here is the challenge I pose to the VMware and virtualization community: If you would like to see me to ride the 23 miles for Friends of Red Rock Canyon, please consider sponsoring me by clicking on the link provided below. All proceeds collected will be donated to Friends of Red Rock Canyon and I will also get my employer to match the final amount.

*** Please RT, re-post and share this with your colleagues, friends and vendors! If you would like to sponsor me to ride in this event or would like to donate to a worthy cause, please consider donating. ***

Click on the "Donate" button below to donate, any amount will help as this is for charity! 

Categories // Uncategorized Tags // vmworld

When Can I Run Apple OSX on vSphere 5?

08.12.2011 by William Lam // 9 Comments

There was a recent post from the famous Scott Drummonds about Running Apple OSX Lion on vSphere 5 and Scott provided his interpretation/opinion of Apple's EULA on virtualizing Apple OSX. Though the EULA can be somewhat confusing, it is true that with the release of vSphere 5, you now can run OSX 10.7 (Lion), 10.6 (Snow Leopard) and 10.5 (Leopard) as a supported guestOS in ESXi 5.

...but there is a catch (there's always a catch)

UPDATE: As of vSphere 5.1, the Apple Mac Pro is now fully supported on running on ESXi 5.1, to get more details, please take a look at this article.

The caveat is that in allowing VMware to run OSX as a virtual machine on vSphere 5, the physical hardware that ESXi 5 is running on MUST be Apple hardware and specifically the XServe 3.1. For those of you who do not follow Apple's hardware closely, the XServe line was recently EOL as of January 31, 2011 and that brings up an interesting problem. If you wanted to virtualize Apple OSX, you would have had to have purchased XServes prior to January 31st or start looking on Ebay with your corporate card 😉

Now, the Apple EULA is not the only thing that is regulating this requirement, in addition, VMware had to implement a software check within ESXi 5 to ensure that the physical hardware is in fact Apple hardware before allowing you to properly boot up an OSX virtual machine. The check looks for the SMC (System Management Controller) when an OSX virtual machine is being powered on and if this check fails, you will get an error and the virtual machine will be powered off automatically. The presence of the SMC is a new property that is exposed in the vSphere 5 API under "hardware" section of the ESXi host.

The property will either return true or false on whether SMC is present. You can easily check your ESXi 5 host by using the vSphere MOB and pointing your browser to the following URL:

https://[esxi5-hostname]/mob/?moid=ha-host&doPath=hardware


Now you can easily determine whether or not your physical host can support running Apple OSX VMs.

As I understand from the beta, only XServer 3.1 will be officially supported and you will not be able to install ESXi 5 on older versions of the hardware. I have also heard mixed results on folks being able to install ESXi 5 on Mac Mini's and Mac Pro's. At this point, hopefully Apple has a change of heart and will update their EULA to allow ESXi 5 to run on "currently available" Apple hardware such as Mac Mini and Mac Pro.

Categories // Uncategorized Tags // ESXi 5.0, mac, osx, vSphere 5.0

  • « Previous Page
  • 1
  • …
  • 511
  • 512
  • 513
  • 514
  • 515
  • …
  • 560
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025