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}")