ServiceInstance si = new ServiceInstance(
new URL(args[0]), args[1], args[2], true);
String hostname = args[3];
Folder rootFolder = si.getRootFolder();
HostSystem host = null;
host = (HostSystem) new InventoryNavigator(
rootFolder).searchManagedEntity("HostSystem", hostname);
if(host==null)
{
System.out.println("Cannot find the host:" + hostname);
si.getServerConnection().logout();
return;
}
HostSnmpSystem hss = host.getHostSnmpSystem();
HostSnmpConfigSpec spec = new HostSnmpConfigSpec();
spec.setEnabled(true);
spec.setReadOnlyCommunities(new String[] {"visdk"});
HostSnmpDestination dest = new HostSnmpDestination();