Posts

Showing posts from November, 2011

UCS API Ruby Script

Yesterday I completed my first vFoglight Script Agent. There was nothing special about the entire process just making sure to do everything the right way. A colleague of mine was instrumental in getting the integrating with vFoglight. The script on the other hand I got working pretty easily. Ruby proved quite useful and I actually installed ruby on Windows and it worked like a charm. Here is the script I used in case anyone wants to dabble a bit.

On windows I downloaded the windows installer (1.8.7-p352) - http://rubyinstaller.org/downloads/ After Ruby is install I loaded just one GEM gem install rest-client Here is the code for the script - ucsmblades.rb #!/usr/bin/ruby -v # # Steve Chambers rough'n'ready RUCS script (Ruby UCS) # No error checking or anything clever, just plain # code to demonstrate how easy this is # require 'rubygems' # rest_client is a GEM addon, so need this to use it require 'rest_client' # hides all the hard stuff for connecting to REST…

Cisco UCS+Ruby+XML+API really cool

I have been working on a Cisco UCS plugin for vFoglight and came across some excellent work from another person. If you are looking to do some work with UCS and Ruby I recommend starting here. I used some of this code to understand what is going on with XML parsing.

http://viewyonder.com/2009/10/04/vmware-ubuntu-ruby-rest-xml-cisco-ucs-api/