This repository was archived by the owner on Jul 1, 2021. It is now read-only.
Description vim = RbVmomi ::VIM . connect ( credentials )
# find the first datacenter
rootFolder = vim . serviceInstance . content . rootFolder
datacenter_array = rootFolder . childEntity . grep ( RbVmomi ::VIM ::Datacenter )
@datacenter = datacenter_array . first
# ESX Hosts SNMP config
host_folder = @datacenter . hostFolder
compute_resources_array = host_folder . childEntity . grep ( RbVmomi ::VIM ::ComputeResource ) . find
compute_resources_array . each do |compute_resource |
host_array = compute_resource . host
host_array . each do |host |
snmp_sys = host . configManager . snmpSystem
puts snmp_sys . configuration
end
end
This raises the following exception:
$ ./rbvmomi_test.rb
[SystemError: ]
/home/nmaludy/.gem/ruby/gems/rbvmomi-1.11.3/lib/rbvmomi/basic_types.rb:200:in ` _get_property'
/home/nmaludy/.gem/ruby/gems/rbvmomi-1.11.3/lib/rbvmomi/basic_types.rb:37:in `block (2 levels) in init'
./rbvmomi_test.rb:73:in ` block (2 levels) in < main> '
./rbvmomi_test.rb:70:in `each'
./rbvmomi_test.rb:70:in ` block in < main> '
./rbvmomi_test.rb:68:in `each'
./rbvmomi_test.rb:68:in ` find'
./rbvmomi_test.rb:68:in `each'
./rbvmomi_test.rb:68:in ` < main> '
According to the documentation here: https://code.vmware.com/doc/preview?id=4206#/doc/vim.host.SnmpSystem.html i should be able to access the configuration and limits properties.
System details:
OS = CentOS 7.4
Ruby = ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
rbvmomi = 1.11.3