diff --git a/src/im_mad/remotes/vmware.d/vmware.rb b/src/im_mad/remotes/vmware.d/vmware.rb index f1df591736..b15b491479 100755 --- a/src/im_mad/remotes/vmware.d/vmware.rb +++ b/src/im_mad/remotes/vmware.d/vmware.rb @@ -34,6 +34,10 @@ end $: << RUBY_LIB_LOCATION +CONF_FILE = ETC_LOCATION + "/vmwarerc" + +ENV['LANG'] = 'C' + require "scripts_common" require 'yaml' require "CommandManager" @@ -90,6 +94,13 @@ if !host exit -1 end +conf = YAML::load(File.read(CONF_FILE)) + +@uri = conf[:libvirt_uri].gsub!('@HOST@', host) + +@user = conf[:username] +@pass = conf[:password] + # Poll the VMware hypervisor rc, data = do_action("virsh -c #{@uri} --readonly nodeinfo")