Show And Tell : First vSphere Plugin for WordPress!

I can’t wait to see what crazy stuff you come up with next…

That was something Chad Sakac told me a few months ago. Back before my latest Celerra VSA version (get it here), or my UIM appliance (sorry that one is vSpecialists eyes only right now).

I really have not done anything off the wall recently. Most of my day to day effort is dedicated to absorbing the information fire-hose that my team deals out on a daily basis. I have a couple of side projects I have been wanting to catch up on but they are all to big to start at the moment.

And to be honest it has been getting to me. I like contributing to the vSphere community and it has been a while (in my head at least) since I released something for that purpose.

So in that spirit I had a brainstorm Friday evening (2 days ago). I had been working on my blog and had a sudden crazy idea…

What if there was a WordPress plugin that would display stats from my vSphere home lab or work? Wouldn’t that rock??

Turns out there isn’t one. Or at least there wasn’t one till till now. After a weekend of coding I am happy to present the first WordPress Plugin for VMware vSphere: WP-vSphereStats

If you are super observant you may have noticed the plugin is actually running in the sidebar on the left. Basically the way it works is pretty simple.

The WP-vSphereStats plugin comes in two pieces. One is the WordPress Plugin itself. It is tested and compatible with WordPress 2.9 and above. It uses the new widget changes in 2.8 and is dependent on some helper changes in 2.9.

The second piece is a Windows command line tool used to pull stats from your vSphere Environment and posts them to a web service enabled by the WP plugin. The combination of these pieces means some pretty cool features:

  1. The WP plugin allows you to run multiple widgets with different stats

  2. All web service calls to your blog are secured by a key that is randomly generated. This prevents outsiders from changing you stats.

  3. I tried to bring a wide range of interesting stats and safe for public stats. These include: total CPU, RAM, Storage, # of Hosts, # VMs, # of VMotions, Power States, etc.

  4. The WP Plugin has error control to alert you when there is a problem with the web call (from admin settings).

  5. The command line tool has two modes. One where you create a configuration file that is saved where you specify. The other where you point it to a configuration and update a WordPress blog. This allows you to update multiple blogs, schedule as you like, and securely caches login information for you vSphere Environment in XML.

  6. I stayed away from creating new tables in the database. Everything is as lightweight as possible.
  7. And best of all, the install is a snap. Two zip files extracted and you’re done.

This whole mini-project was a mini-vacation for me from working on my VMworld session and studying for my CCNP test next week. I tried to keep the whole program simple to allow easier support for me andย  more fun for you. I scrapped the idea of an installed Windows Service and opted for the command line tool. But, I did spare no expense in time making sure the WP plugin was slick as can be. My apologies to those that don’t use WordPress. I may find time to write for another CMS but, if you are feeling intrepid, feel free to convert to your own purpose ๐Ÿ™‚

To download and use the WP-vSphereStats plugin go here: WP-vSphereStats plugin

The plugin is in the process of being added to the WordPress Codex. Should be available from there by the end of the week.

And as always please leave comments if you like or dislike. Feedback always helps, especially if you have an idea on how to improve.
See you at VMworld 2010

.nick

Featured Tools

30 Comments Leave a comment

  1. Nice stuff!!

    I was looking on your site info about your “home lab” i like to see what others people have at home for VMware testing purpose, i cant find info about it. any changes to get that post ?

    I’m downloading the plug-in and gonna test it !!! feedback is coming.

  2. Very cool idea, and the installation really couldn’t be simpler. My inner copy editor can’t resist pointing out one barely-an-issue, though–the vMotion counter could use a comma separator for when the value goes over 999, to keep things consistent. I’d guess Power States is missing that, too, but I don’t have that many VMs to check.

  3. Hi Nick,

    The plugin installer installs files to the following location which is correct:
    /wp-content/plugins/WP-vSphereStats/

    However, the image references are pointing to the following location:
    /wp-admin/wp-content/plugins/WP-vSphereStats/

    I manually created the path and dumped the images in there so it would work but wp-admin is not where these files should be going and the WP developers may be able to confirm this.

  4. Nick, allow me to modify that comment – the broken images/improper path is only in the Site Admin|Settings|vSphereStats page. Once the widget is added, it’s pulling the images from the correct location.

    Sorry about the confusion.

    Jas

  5. Further clarification on the image links – they seem to be dynamically changing based on what page of the blog I’m on. For example, when drilled down reading an article, the images are once again broken because they are looking for the image in the full URL which includes the title of the blog article.

    ie.

  6. Thanks Jason. Been busy studying so I am behind on this. I will fix the issue (thanks for demo'ing it) and release a fix. I now have SVN access to WP plugin codex so next rev will be upgradable from within the dashboard.

  7. Thanks man. The content variables was something I was going to add to the next release but you did all the work for me (and probably better as well)! Will merge all your changes.

  8. Actually, looks like you are running an older version (1.0). This is fixed in 1.01 which is out, but just wait for 1.5 which I will drop by tomorrow.

  9. Thanks Jason. Been busy studying so I am behind on this. I will fix the issue (thanks for demo’ing it) and release a fix. I now have SVN access to WP plugin codex so next rev will be upgradable from within the dashboard.

  10. Thanks man. The content variables was something I was going to add to the next release but you did all the work for me (and probably better as well)! Will merge all your changes.

  11. Actually, looks like you are running an older version (1.0). This is fixed in 1.01 which is out, but just wait for 1.5 which I will drop by tomorrow.

  12. Any error output would be greatly appreciated as when I run based off my config file I get “An error occurred, please check your config file”. Any ideas as to why it’s not working or as to how I can enable additional logging within your CLI side application?

  13. Anyone tested this on Windows x64? I’m in the process of upgrading my home lab to vSphere 4.1 and hence I’ve had to rebuild my 32bit vCentre server to 64 bit. I’ve been running this plugin fine for a few months on my old server but when I run the CLI wizard on the new server I get an error;

    “Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘VimService, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.”

    I’ve got the .NET Framwork 3.5 SP1 already installed and I’m logged in as admin. Any ideas?

%d bloggers like this: