Former HPE Products
cancel
Showing results for 
Search instead for 
Did you mean: 

nnmi webservice for interface

 
Mike_Gray
Occasional Contributor

nnmi webservice for interface

Hello team,

 

I am using the following code to get node details from nnmi, can we get the interface status using the same way ?

from suds.client import Client
from suds.transport.http import HttpAuthenticated

import time
import json
import datetime
import time
now = datetime.datetime.now()
currenttime = now - datetime.timedelta(hours=100)
lstime = time.mktime(currenttime.timetuple())
timems = int(lstime)*1000



mgmtip = "192.168.10.20"
hosts = open('/etc/hosts','r')
for line in hosts:
    if mgmtip in line:
        hostname = ', '.join(line.split()[1:])
#print hostname


t = HttpAuthenticated(username='user', password='Password')

url = 'http://host/NodeBeanService/NodeBean?wsdl'

client = Client(url, transport=t)
filter1 = client.factory.create('ns3:condition')
filter1.name = "sourceNodeName"
filter1.operator = "LIKE"
filter1.value = hostname


filter = client.factory.create('ns3:expression')
filter.operator = "AND"
filter.subFilters = [filter2, filterlimit]

allNodes = client.service.getNodes(filter)
#print "Nodes in topology:", len(allNodes.item)
print allNodes
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: nnmi webservice for interface

winkra
Valued Contributor

Re: nnmi webservice for interface

Hello

Sorry for the inconvenience of having the Software content in read-only as we migrated to a new instance. The new Software Community is now live at community.saas.hpe.com. You can use your same credentials to log in.

Please repost your question to the NNM forum here:

https://community.saas.hpe.com/t5/Network-Management-Solutions/ct-p/sws-NNM

Thanks,

Pratik_03
Advisor

Re: nnmi webservice for interface

Hi,

The mentioned link for https://community.saas.hpe.com/ is not opening...