I am trying to add interfaces via the SDK, but I do not want to do it via the discovery since it returns invalid responses for the operational and admin status of the interface, so I am pulling that information externally.
Can I add the interfaces just via NodeID and Interface Index, or do I have to have all the same fields as the discovery populates (below)?
{
"InterfaceID": 45610,
"ifType": 24,
"ifSpeed": 0.0,
"ifSubType": 0,
"Caption": "Loopback0 - Lo0",
"ifAdminStatus": 0,
"ifIndex": 9,
"Manageable": true,
"ifOperStatus": 4
},
def add_interfaces(interfaces, nodeid):
requests.packages.urllib3.disable_warnings()
npm_server =
username =
password =
swis = SwisClient(npm_server, username, password)
addition_results = swis.invoke('Orion.NPM.Interfaces','AddInterfacesOnNode', nodeid, interfaces, 'AddDefaultPollers')
print(addition_results)
def main():
test_interface_parameters = [{"ifIndex": 1}]
add_interfaces(test_interface_parameters, 4903)
if __name__ == '__main__': main()
This seems to work, but for a while I got some strangeness happening on the node. The interface would show up but as "unknown" and would take some time to populate and start reporting statistics, even after hitting "poll now." I came back to my desk overnight and there is still an "unknown" interface on my node, although the interfaces I did remove and add via the script are there.
I just want to make sure there are no major issues doing it by just ifindex before I start trying to do this on a couple hundred nodes.
Thanks!