Get Network Inventory IPs with Script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎06-28-2018 01:41 PM
I'm working on a Python script to help with some networking tasks. Is there a way that I can get the IPs of my network devices from EMC programatically? Rather than hardcoding the IPs in the script, I'd like to use EMC as the authoritative source for that information. It would be even better if I could pull other attributes like OS and Version, as well.
I've been looking at the API, but I haven't seen a way to use that method to pull the information.
I've been looking at the API, but I haven't seen a way to use that method to pull the information.
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎07-01-2018 05:59 PM
Or if you don't like soap , you can use REST calls like:
import requestsuser = 'your user'
pw = 'your password'
xmcip = 'your xmcip:8443'
request = '/axis/services/NetSightDeviceWebService/getAllDevices'
r = requests.get('https://' + user + ':' + pw + '@' + xmcip + request, verify = False)
import requestsuser = 'your user'
pw = 'your password'
xmcip = 'your xmcip:8443'
request = '/axis/services/NetSightDeviceWebService/getAllDevices'
r = requests.get('https://' + user + ':' + pw + '@' + xmcip + request, verify = False)
Regards
Stephan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎06-28-2018 11:08 PM
Hi Terren,
The APIs are defined in the wsdl file.
Here are several lines of python code for your reference:
import deep
def service (self, xmc_ip): wsdl_url = 'https://' + xmc_ip +':8443/axis/services/NetSightDeviceWebService?wsdl'
client = zeep.CachingClient (wsdl=wsdl_url, transport=self.transport, strict=False)
return client.bind ('NetSightDeviceWebService', "NetSightDeviceWebServiceSOAP11port_https1")
The APIs are defined in the wsdl file.
Here are several lines of python code for your reference:
import deep
def service (self, xmc_ip): wsdl_url = 'https://' + xmc_ip +':8443/axis/services/NetSightDeviceWebService?wsdl'
client = zeep.CachingClient (wsdl=wsdl_url, transport=self.transport, strict=False)
return client.bind ('NetSightDeviceWebService', "NetSightDeviceWebServiceSOAP11port_https1")
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎06-28-2018 02:12 PM
Hello Terren,
are you looking for network devices like switches or end systems (=clients)?
All switch data you will receive with:
Stephan
are you looking for network devices like switches or end systems (=clients)?
All switch data you will receive with:
- Get all devices (and there ips) with this command: "https://YourNetSightIP:8443/axis/services/NetSightDeviceWebService/getAllDevices". Take all ips form the answer to this request and put the ips in the command here:
- "https://YourNetSightIP:8443/axis/services/InventoryWebService/getDeviceProperties?ipAddress=IpFromStepOne" in a loop of you script.
Stephan
Regards
Stephan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎06-28-2018 02:12 PM
Yeah, I'm looking for the switches.
Thanks, I'll give this a shot.
Thanks, I'll give this a shot.
