Tools

Look I’m A Tool! : vSphere Session Monitor 1.0

Patio hacking

(version 2.0 is now released! Go here)

So eight days ago I decided I was going to give another try to write an application that uses the VMware vSphere Web SDK. I had attempted this at least a year ago and never finished anything because of *insert excuse here*.

I always have ideas for cool (at least in my mind) tools swirling in my head. Even though I am a data center quadruple threat kind of guy (Microsoft, VMware, Cisco, and EMC), I like to do scripting and development to sharpen my mind. I always thought I was going to be a developer in college and love to turn ideas into reality.

So last week I fired up Visual Studio 2008 and started spending some nights coding. Along the way I found out some interesting things, caused a great blog post, and had a blast learning more about vSphere. I have a tendency to roll my challenges together and so decided to make this slick as possible including:

  • Making it a Tray Icon (A must for this app)
  • Doing all forms in WPF which I have never worked with before (XAML crash course)
  • Making all background processes multithreaded and eliminating the need for timers
  • Learning how to effectively use PropertyCollector.WaitForUpdates method to touch vCenter as little as possible
  • Building a proper MSI setup

On top of all this I went and wrote all the operations, connections, and credential pieces into classes for re-usability.  I am a bit of a perfectionist and probably went WAY overboard without much gain.

So without further self flagellation and glorification I present the: [drain file 2 url vSphere Session Monitor]

 

This little bad boy right here’s only purpose is to keep you informed of who is on your vCenter server.
Let me walk you through the steps to try it out.

Download the x86 installer from here: [drain file 2 url vSphere Session Monitor]

I do not endorse using this tool in production. Please test in a lab environment until you (if ever!) are comfortable using elsewhere.

Run the installer on the workstation of your choice. You must have .NET 3.5 installed. Also this workstation must have the ability to hit the vCenter Web SDK which is https://*your vCenter Server/sdk

After the application is installed, launch it from your new desktop shortcut or Program Files menu.

The application will prompt you for your vCenter fully qualified domain name (FQDN):

It will then prompt for you vCenter credentials:

If you entered everything correctly the tool will open up the main page:

And down in your notification tray a little pop-up will list current vCenter sessions:

 

Couple quick UI things to get out of the way:

  • To close the application, click the “X” in the main window.
  • Minimizing will hide the form. You can bring it back or hide it with a left-click on the notification tray icon.
  • If you right-click on the tray icon it will list the current users on the vCenter host.
  • The “Change Credentials” button will allow you to switch username and password. And the ‘Change vCenter Server” will let you change the FQDN you entered.

I bet at this point you are thinking: “Well Nick, that is cool and dandy but I can get that info from my vSphere client! Way to reinvent the wheel…”
Well… now for the best part. This is the real reason I wrote this little app. It all started with my senior engineer, Justin. He had a nasty habit of yelling out “What are you doing?” every time someone did something on a vCenter server. That got me thinking; “It would be cool if something popped up telling Justin someone logged in. And it would be even cooler if you didn’t have to have the vSphere Client running to do it.”
So with the vSphere Session Manager, the instant someone logs into your vSphere vCenter, you see this:

Not super fancy but if you want to know when someone is playing in your pool (like Justin) this will let you know.
Here are couple features I was going to add but will (maybe) later:

  • Storing of credentials (encrypted) – not too difficult, a little RSA key generation, mix in some environment specific salt, and dehydrate a class to XML.
  • Allow multiple vCenter hosts – You can open multiple monitors to watch each vCenter for now

So that is a few hours of my life dedicated to seeing how easy it is to utilize the VMware vSphere Web SDK. And from a datacenter guy I can definitely say that the documentation, community (thanks @sjin2008), and SDK made this a pretty easy task. I highly recommend everyone take your cool tool ideas and try something out too.

Do me a favor and leave comments with feedback/questions. Thanks!

 

.nick

13 thoughts on “Look I’m A Tool! : vSphere Session Monitor 1.0

  1. Installed it on Win7. It works however it’s not minimizing to the systray (leaves a small window on the desktop when minimized and also has a systray icon) and when closed it forgets the settings (FQDN & credentials). Maybe these problems are related to the fact that my normal (AD) useraccount is not a local admin on my Win7?

    • Thanks

      The minimize issue is a small bug I just noticed too. Easy fix I will put in the next release. The app right now does not store your credentials. I did not want to save state on the creds unless I could secure them at rest. That will come in the next release or soon after.

      At this point I am waiting for feedback on all the bugs so I can get an updated one out. I didn’t do very much QA.

  2. Pingback: vSphere Session Monitor 1.0 | Virtualization Spotlight

  3. This will be a great side app for a VMware admin who likes to keep an eye on the systems. Any chance of allowing us to download the source code and possibly modify it for other tasks or adding more capabilities?

  4. Thanks Jared,

    I will be releasing the source eventually. I first have to get it in decent enough shape (comments, naming standards, structure) that I won’t embarrass myself totally :)

    Cheers

    .nick

  5. Pingback: Tool to monitor who is using VMware vCenter «

  6. Pingback: Top 5 Planet V12n blog posts week 04 | VMvisor

  7. Pingback: RTFM Education » Blog Archive » vNews – Mar, 2010

  8. Pingback: Virtualize » Mantendo o olho no seu vSphere Server

  9. Thanks

    The reduce issue is a small annoy I recently discovered too. Easy repair I am going to put in the following release. The app today doesn’t store your own credentials. I didn’t want to save state on the creds until I really could risk-free them at rest. That will be the following release or perhaps soon after.

    At this point We am waiting for feedback on all the insects so We can get an updated one away. My partner and i failed to perform a lot QA.

Comments are closed.