Adding an Interface to an existing Node without rediscovery or listing resources

Hi All,

I am running into an issue and I need your expertise. I need to add an interface to a device already discovered in my setup, but without using the List Resources option.

There is a specific reason for this. The device in question has thousands of interfaces and it does not coup very well with huge SNMP storms, so if I use the List Resources or try to discover the node with all interfaces in it it eventually times out and nothing is discovered. It is not a problem with SolarWinds, is just the type of device that doesn't want to cooperate. I have reported the issue to the vendor, and they said a future release will make the equipment more SNMP "friendly" but that can take months and I need an immediate solution.

So what I am trying to do is to "artificially" add interfaces which I know are there and working and for that I am using SDK and the python orionsdk library and I had some success although the behavior is not what I expected,

I was able to add interfaces based on their indexes, but the problem is, they are created with the status unknown but they are never polled, so basically it stays in that state permanently which is not what I need. My assumption was that the interfaces would be created and naturally polled, as long as the polling interval was configured, but that is not what is happening. I suspect something is missing in the background that prevents the interface being polled like any other discovered via the proper way or maybe interfaces can't simply be added this way.

 I am attaching the script I used which is basically a modification of an example I found on GitHub. Your thoughts on this would be appreciated.

from __future__ import print_function
from orionsdk import SwisClient
import requests

# Set your SolarWinds server details
solarwinds_server  = 'x.x.x.x'
username = 'x'
password = 'xxxxxxx'
verify = False

if not verify:
    from requests.packages.urllib3.exceptions import InsecureRequestWarning
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

if __name__ == '__main__':
    
    # Connect to SolarWinds server
    swis = SwisClient(solarwinds_server, username, password)

    try:
        # Replace these values with the actual details
        node_id = 2187
        interface_index = 100004
        interface_ObjectSubType = 'SNMP'
        interface_Status = 1
        interface_startcollection = 9
        interface_nextpoll = '2024-12-08 17:30:00.0'
        interface_UnManaged = 0
        interfaces_pollinterval = 180
        interfaces_rediscoveryInterval = 30

        new_interface_properties = {
            'NodeID' : node_id,
            'Index': interface_index,
            'ObjectSubType': interface_ObjectSubType,
            'Status': interface_Status,
            'StatCollection': interface_startcollection,
            'UnManaged': interface_UnManaged,
            'PollInterval': interfaces_pollinterval,
            'RediscoveryInterval': interfaces_rediscoveryInterval,
            'NextPoll': interface_nextpoll
        }
        # Call the function to create the artificial interface
        new_interface_uri = swis.create('Orion.NPM.Interfaces', **new_interface_properties)
        print(f"Artificial interface created: {new_interface_uri}")
    except Exception as e:
        print(f"Error connecting to SolarWinds: {e}")

Parents
  • If you are adding them manually in this fashion you also have to create the pollers.  That is why they never get a status.  Here is the section in the SDK:

    github.com/.../How-to-assign-specific-poller-to-a-Node

  • Hi James,

    Thank you for your reply. I thought that would be the case so I checked the pollers on the node I am trying to create the interfaces on, and compared it with another node where I was able to discover the interfaces the proper way (just by luck). And the Node Pollers are exactly the same; as per the Interface Pollers they were in fact missing, so I create them but the interface is still in the same state.

    So this is an interface being pulled correctly and discovered also the right way on a different node:

    This one was artificial created and then the interfaces pollers created based on the interfaceIDs (the node pollers are also the same on both nodes):

    They look similar but one is polling the other isn't so I am surely missing something else.

  • How long are you waiting for the status to change? One thing you can check is the historical status polls and see if there was actually a status reported, even if that is unknown.   At that point you know that it is indeed polling, but is unable to determine status from the device which as you've identified could be a general SNMP problem or a bad ifindex.  If there is no record of polling then you're right likely something missing in adding the resource to Orion, but in my experience adding the resources and their pollers is a sure way to accomplish your goal, given the information on the device side is consistent. 

  • Hi James,

    I checked and I couldn't see anything on the historical status polls. It is simply frozen and not doing anything. As you said I think I am missing something. What I am missing that is the million dollar question, I will dig a little bit more and see what I can find out. Thank you for you help and suggestions Pray

Reply Children
No Data