This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Java sample to automatically discover interfaces on Nodes

Is there a java sample to automatically discover interfaces on Nodes? If so, could someone please provide that sample. I am using NPM 11.5.2 version.

Thanks!!

  • 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!

  • Hi tdanner

    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[2];

    messageElements[0] = new RPCParam("NodeID", 118);

    messageElements[1] = new RPCParam("PollerType", "AddDefaultPollers");

    parameters.set_any(messageElements);

    ArrayOfXmlElementXmlElement[] parameterWrapper = new ArrayOfXmlElementXmlElement[1];

    parameterWrapper[0] = 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 [61] 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 [61] 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?

  • 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).

  • 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"

    Thanks