No, we only have that sample in PowerShell - OrionSDK/NPM.DiscoverAndAddInterfacesOnNode.ps1 at master · solarwinds/OrionSDK · GitHub. But you can call the same verbs from Java just like any other verbs.
tdanner, There is no equivalent verb to DiscoverInterfacesOnNode for volumes, correct? I am looking to do something similar for volumes.
Also how do you know what properties you can use with some of these commands like DiscoveredInterfaces.DiscoveredLiteInterface? I can't figure out how to do a get-member on this command so I'm not sure what properties I can use to filter with it.
Thanks as always!
No, there is no equivalent for volumes.
Easiest way to see what's in the DiscoveredLiteInterface structure is to just dump it to the console. Or run it in a debugger and check it out there (if you are using PowerShell, the PowerShell ISE debugger works fine).
I have tried the following code and it works with no error but then I am unable to auto-discover interfaces on node:
ArrayOfXmlElementXmlElement parameters = new ArrayOfXmlElementXmlElement();
MessageElement messageElements = new MessageElement;
messageElements = new RPCParam("NodeID", 118);
messageElements = new RPCParam("PollerType", "AddDefaultPollers");
ArrayOfXmlElementXmlElement parameterWrapper = new ArrayOfXmlElementXmlElement;
parameterWrapper = parameters;
swis.invoke("Orion.NPM.Interfaces", "DiscoverInterfacesOnNode", parameterWrapper);
There is no error however the following information got logged in the C:\ProgramData\SolarWinds\InformationService\v3.0\Orion.informationservice file
2015-09-08 13:36:07,243  INFO SolarWinds.Orion.Core.Common.WCFChannelFactory`1 - (null) Channel NPMBusinessLayer to net.tcp://--host--/orion/npm/businesslayer openned 2015-09-08 13:36:35,130  WARN SolarWinds.InformationService.Core.InformationService - (null) Support! -- LONG RUNNING QUERY: Session - Query took 27909.7157 ms: Verb Orion.NPM.Interfaces.DiscoverInterfacesOnNode
Could you please let me know what is happening?
That verb causes NPM to scan the device (using SNMP) for all interfaces. On a device with many physical or virtual interfaces, it is not outside the realm of possibility that it could take 28 seconds to do this.
But that verb does not cause any changes to the NPM configuration. You have to take the output, remove elements for interfaces you do not want to monitor, and pass it to the companion verb AddInterfacesOnNode to actually start monitoring interfaces.
When I try to print the swis.invoke(), the result is "com.solarwinds.schemas._2007._08.informationservice.InvokeResponseInvokeResult@2fb70372". I am unable to trace what is the return type in order to filter the interfaces. Could you please put some light into this?
I am unable to understand how the following are being used in the sample provided by you? " $discovered.DiscoveredInterfaces.DiscoveredLiteInterface" and "$discovered.DiscoveredInterfaces"