Nick Weaver on Twitter
Nick Weaver on Facebook Nick Weaver on LinkedIn Nickapedia RSS Feed
Vmware vExpert 2010

My vSphere Environment

CPU: 10,688 MHz
RAM: 8,186 MB
Storage: 122 GB


ESX Hosts: 2
Resource Pools: 3
Virtual Machines: 2


VMotions: 0
Power States:
(1) (1) (0)



last update
19 days, 23 hrs and 25 min.

plugin by nickapedia

What is…    RSS

BlogWithIntegrity.com

vSphere Mini Monitor : Now With More Cowbell!

The Twitter fail whale error message.
Image via Wikipedia

Roughly three weeks ago I released my first vSphere tool called the vSphere Session Monitor. The response to this was extremely positive and hopefully accomplished my goal of encouraging others to spend some time experimenting with their own ideas. In my mind, the success of adoption of cloud technologies within an organization will be tied to how they grasp the extensibility of virtualization using vSphere.

For me, a lot changed in the last three weeks. I announced I was joining EMC and leaving my current company which, when the dust settled, ended up resulting in a nice two week temporary unemployment period.

Back when I released VSM 1.0 and before the icons were dry on the shortcuts, I had already written up a mental list of features I wished I had added to it. So I quickly got busy working on the new version. However, progress was quickly slowed down to a crawl by the fact that I no longer had an environment to test against. So after spending half a week getting a decent lab setup I finally got back to finishing the new tool. I feel this version will really show that there are almost unlimited possibilities to what you can do with the API’s that VMware has provided.

First things first, the vSphere Session Monitor will from now on be officially renamed the vSphere Mini Monitor. This is version 2.0 and brings a massive list of features, brand new UI, and structured approach to how it is designed.

So here is what is new in 2.0:VMM UI

New UI
Because of all the new features I had to revamp the UI to be better organized and look slicker.

Saved Configuration
One big request from the last release was the ability to save credentials when the VSM (now VMM) was closed. The new VMM will save all configurations when closed including username, password, vCenter URL, and alerts and channel settings. I also implemented encryption of all security-sensitive data (passwords, tokens). These configurations are stored per unique user securely for multiple user workstations and all encrypted credentials will not work for another user.

Alerts
Now instead of just monitoring sessions on your vCenter server, the VMM will now monitor a large number of changes to multiple objects. Within the UI there is now the ability to turn on or off specific Alert categories. Here is a list of the possible choices:

Sessions
New Session*
List Sessions*
Terminated Session (New!)

Datacenter
Not very much here yet

Cluster
Creation
Deletion
Changes (HA, DRS, etc)

Host
Connection/Disconnection
Addition/Removal
Changes (Network, Storage, Maintenance Mode State)

Resource Pool
Creation
Deletion
Changes

Virtual Machine
Creation
Deletion
Changes (Device Add/Remove, CPU, Memory)
Snapshots

Distributed Switch

 

Creation
Deletion
Changes (Uplinks, Port Groups)

Datastores
Renaming

*original features

As you can see, this was quite a lot of work. All the alerts are based around letting you know something is occurring and if available who is doing it. The really cool ones are at the Virtual Machine and Host level. Those were quite fun to code.

ChannelsVMM Channels
In VSM 1.0 there was only one method to alert the user, the notification tray. But, what if you weren’t looking at your tray? What if you were down the hall eating an apple and getting the newest gossip from the front desk guy/girl? That is where the definition of ‘Channels’ comes in. You can now choose to alert via multiple methods. Here is a list and explanation of each:

Notification Tray
This is pretty similar to the VSM 1.0 except with the addition of new alerts it can be quite a bit busier. I also changed it to condense similar messages into one popup instead of multiple. This means if someone changes the CPU count, removed a CD device, and renames a VM you will see one popup showing all three changes.

Email
Pretty self-explanatory, this will basically send an email to you or a DL with the exact text as the notification tray popups. This requires SMTP relay rights for the IP that VMM is sending from to the email domain VMM is sending to for the server specified in the settings. This really comes in handy when you are going to be out of office or away from your desk and want to still see the alerts.

RSS Feed
This is my second favorite channel and works really well. Basically you set an output path, either local or UNC, that VMM will drop an RSS.XML file into. You can have the path be a folder on a web server or run a script to copy it to one. This will provide an RSS 2.0 compliant feed of the last thirty VMM alerts and will be updated each new alert. This is very handy for those that don’t like the notification tray or want to share alerts among a team.

Twitter
Yes, you read that right. By far my favorite feature in the new VMM 2.0 is that you can now use Twitter as a channel for alerting. This required quite a bit of elbow grease and testing but works wonderfully.

When you enable this channel the VMM will open a browser window prompting you to Authorize VMM for a Twitter account. It will also open an input window for you to enter the corresponding PIN number. After you login into the chosen Twitter account and approve the VMMTool application, Twitter will supply a PIN which you type/copy/paste into the VMM input window. This will authorize VMM to update this account’s tweetstream with alerts. This authorization is per workstation and per user. It will stay authorized until you remove access via Twitter or delete the VMM application. All this is done via OAuth and even the tokens used are still encrypted at rest just to be sure.

This rocks for several reasons. If you are a Twitter addict like me you check your tweets every five minutes. Now your vCenter server will keep you up to date on what is going on from your cellphone or Twitter client. Big things to remember on this are: Don’t use your personal Twitter account for this. Make sure you make the Twitter account private to control who sees the tweets. Also, Twitter’s API is a little hit or miss sometimes(Fail Whale). Even though I get a update successful message back, sometimes the tweet may not show. I didn’t build in tweet validation yet so your mileage may vary. And remember that you don’t own the data on Twitter.

 

The purpose of the vSphere Mini Monitor is to provide a simple extension of the vSphere Web SDK to allow for real-time alerting of important user-based events on your vCenter server. It is not meant to replace a holistic monitoring platform. I wrote it to be secure, multithreaded, and lightweight. It is simply a cool geeky tool.

One quick disclaimer: I do not endorse using the VMM for anything other than your whitebox home lab in the closet under the stairs and even then only late at night when the wife and kids are asleep. I am not responsible for anyone opening up Visual Studio or a Java IDE and spending countless hours drinking Mountain Dew and learning object class structure. This product is not endorsed or affiliated with EMC Corporation at all. I technically don’t work for EMC till next week but, I am future-proofing this post.

To download the vSphere Mini Monitor click one of the links below. I have built both x86 and x64 versions. I only ask three things in return for this tool:

  1. Please post a comment below with your feedback. Bad, good, or indifferent.
  2. If you are a Twitter user follow me at @lynxbat to catch updates as they come out.
  3. Think real hard about the last cool idea you had. Now plan sometime this week and start working on it.

http://nickapedia.com/wp-content/plugins/downloads-manager/img/icons/setup.gif download: vSphere Mini Monitor 2.0 - x86 (2.22MB)
added: 15/02/2010
clicks: 1335
description:

http://nickapedia.com/wp-content/plugins/downloads-manager/img/icons/setup.gif download: vSphere Mini Monitor 2.0 - x64 (2.22MB)
added: 15/02/2010
clicks: 823
description:

.nick

  • Cryogenx
    Any chance of it sending out twitter alerts for User initiated vMotions and/or when an alert is triggered within vcenter?
  • Great tools,

    I use it now on our whole farm (100 esx), and i'm sure you can help us with two "simple feature"

    1) In place of twitter, allow us to use local Status.net server with the ability to use the object as user
    2) Add the ability to run an external program to fill the change in a cmdb

    If you can't do that for us, please give our code to the community, and i'm sure your tools will become a "best practice tools " in the vm world

    Many thank's for this piece of code

    Ph Koenig
  • Eff Norwood
    Love it - good work. Can you share the source code please? It would be fun to further extend this!
  • Thanks - works very well. Crashed a few times the first time I ran it but seems to be stable now. Gotta say there was some surprise from the team when it first sent everyone an email when someone made a change to a VM..

    Only suggestion is that it would be useful to run as a service (for email/twitter updates), but as a fun tool to run on my workstation it certainly does the job and works well with a read-only vSphere login.
  • Mongo
    Great tool. Do you have any plans to allow any trending options? Maybe send the updates to a log that can be imported or directly to database?

    Thanks for the hard work!
  • Ron Butterworth
    Love the app, can the alerts/notifications be placed into the Windows Event logs?
  • Jeff Hall
    What ports do I need to open up on my firewall for the mini monitor? I'm accessing my lab remotely from a hotel back thru my D-Link router at home and I've only been able to get it working so far by putting my vCenter Server in the DMZ outside of the firewall, but I don't want to keep it out there for long! :-D

    Thanks!

    Jeff
  • You need to just open port 80 to the VCenter host.
  • Edward Marshall
    Superb tool, thanks for making it available free.
    Just an idea for a killer feature, it would be really cool if you could click the icon and have a really quick view of the ESX hosts. A pretty diagram if you wish showing host health status/load for each cluster.
  • Great tool. Thank you. One thing I noticed that it only notifies about the first change somebody makes. Example: I go into a cluster and turn off DRS and HA. Only one change is in the alert. Again, thank you - this is awesome.
  • Nigel
    Re my post above, have got it working - if I'm just *logged on* as an admin I get the behaviour described above, but if I check "Run this program as an administrator" on the Compatibility tab and then run it, it works fine. Don't you just love UAC?!

    Thanks for a really useful tool.
  • Nigel
    Hi Nick,

    An excellent tool! However, I can't get it to work for me on Win 7 x64 (have tried both x86 and x84 versions of VMM). I configure it initially with a vCenter server and credentials, but the icon in the notification area is non-responsive. If I double-click it several times the main window opens, but with nothing in the configuration fields. If I try to configure it from there I can entre the appropriate details but it then crashes with the standard Windows "vSphere Session Monitor has stopped working" message. I'm running it as an admin.

    It works fine on Win XP on the same machine using the same vCenter and account. Any ideas?

    Cheers,


    Nigel
  • 1an3
    Disregard previous, I wasn't running as admin, all works fine now. Sorry!
  • 1an3
    Win7, crashes out when configuring the username/pwd (immediately after entering). Running as admin AFAIK.
  • Robert
    Super cool tool. Got it running on Windows 7 and am really liking it. Only caveat I've found is that it needs to be run as an Administrator (assuming because the prefs are stored in the application directory versus ..\user\AppData...)
  • Robert
    Of course simply granting modify rights to the 'config' directory gets around my previously noted caveat.
  • Hmm. That is an interesting point. I will change the config directory to the user's AppData dir in their profile. That will fix the rights issue. Thanks for the feedback!
  • Rob Preston
    Sweet tool. Now I can spy on everyone who can access the Server. How cool is that.

    Seriously, with the ability to email alerts, I don't have to keep a client open on my desktop. Thanks Nick... Keep up the good work.
  • Tim Davis
    So far it is pretty cool. I will have to play around with it some more.


    I crashed it while adding twitter, then canceling before entering pin. I will play around with it some more and let you know how things turn out.
  • I pointed it at an ESXi server rather than a vCenter on a whim;

    System.NullReferenceException: Object reference not set to an instance of an object.
    at vSphereMiniMonitor.vSphereOperation.vCurrentSession(VimService vService, ManagedObjectReference vPropCol, ManagedObjectReference vSessionManager)
    at vSphereMiniMonitor.MainWindow.ListSessions()
    at System.Windows.Forms.NotifyIcon.WmMouseUp(Message& m, MouseButtons button)
    at System.Windows.Forms.NotifyIcon.WndProc(Message& msg)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes