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.

Download x86 version
Download x64 version

.nick

Tools

72 Comments Leave a comment

  1. This is cool. Can’t wait to use this “Prime Time” tool in my new enviroment. Keep up the awesome work and accomplishments.

  2. 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)

  3. 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.

  4. 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.

  5. 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 ..userAppData…)

      • 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!

  6. 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

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

  8. 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.

  9. 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.

  10. 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! 😀

    Thanks!

    Jeff

  11. 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!

  12. 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.

  13. Love it – good work. Can you share the source code please? It would be fun to further extend this!

  14. 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

  15. Any chance of it sending out twitter alerts for User initiated vMotions and/or when an alert is triggered within vcenter?

  16. Looks like the link to download the application is broken. Does anyone have a link to this file somewhere else? Thanks.

  17. I came across this from a top 10 cool add ons list from another blog and the link appears to be broke for the install.

  18. Does it store the alers somewhere? I have it set to go to my email, but that’s a lot of messages. Any way to save the alerts to a file, maybe?

  19. Ni Nick,
    it’s possible to give the code to the community for further development of vSphere Mini Monitor?
    Many good ideas
    – write logfile
    – monitor more vCenters
    – run as service
    – run external program
    – and so on

  20. Dear Nick,

    Thank you for your Mini Monitor. I have downloaded it 1 year ago, but not I can’t download now.
    The downloading can’t start and I get a timeout error with 32 and 64bit link too.

    Please fix it, because I must have use it.

    Thank you!
    Best regards,
    Andras Tim (andras.tim@gmail.com)

    • Links are working. It is hosted on the same site as this blog. Maybe your internet doesn’t allow FTP? Are you trying from work or VPN?

      .nick

  21. Hello guys,

    I get such error when I click on tray icon on this brilliant software. Havy you any ideas about that?

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    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 vSphereMiniMonitor.MainWindow.Notify_SingleClick(Object sender, MouseEventArgs e)
       at System.Windows.Forms.NotifyIcon.OnMouseClick(MouseEventArgs mea)
       at System.Windows.Forms.NotifyIcon.WmMouseUp(Message& m, MouseButtons button)
       at System.Windows.Forms.NotifyIcon.WndProc(Message& msg)
       at System.Windows.Forms.NotifyIcon.NotifyIconNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    —————————————-
    vSphere Mini Monitor
        Assembly Version: 1.2.0.0
        Win32 Version: 1.2.0.0
        CodeBase: file:///C:/Program%20Files%20(x86)/Nickapedia.com/vSphere%20Mini%20Monitor/vSphere%20Mini%20Monitor.exe
    —————————————-
    PresentationFramework
        Assembly Version: 3.0.0.0
        Win32 Version: 3.0.6920.4902 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll
    —————————————-
    WindowsBase
        Assembly Version: 3.0.0.0
        Win32 Version: 3.0.6920.4902 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
    —————————————-
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    —————————————-
    PresentationCore
        Assembly Version: 3.0.0.0
        Win32 Version: 3.0.6920.4902 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_32/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
    —————————————-
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    —————————————-
    VimService
        Assembly Version: 0.0.0.0
        Win32 Version: 0.0.0.0
        CodeBase: file:///C:/Program%20Files%20(x86)/Nickapedia.com/vSphere%20Mini%20Monitor/VimService.DLL
    —————————————-
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    —————————————-
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    —————————————-
    PresentationFramework.Classic
        Assembly Version: 3.0.0.0
        Win32 Version: 3.0.6920.4902 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/PresentationFramework.Classic/3.0.0.0__31bf3856ad364e35/PresentationFramework.Classic.dll
    —————————————-
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    —————————————-
    Microsoft.VisualBasic
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    —————————————-
    lgtttxxt
        Assembly Version: 1.2.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    —————————————-
    System.Web.Services
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
    —————————————-

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

       

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

%d bloggers like this: