09-21-2017 02:53 AM - last edited on 03-25-2019 01:20 PM by ciscomoderator
Dear All,
We have approximately 300 devices in WAN (All connected with MPLS links), How can we discover the devices using APICEM, Autodiscovery
Thanks
Phani
09-21-2017 05:29 PM
you would need to use the "discovery" app to kick off a discovery process.
If you do not have CDP access to the devices, then you would need to use IP range.
09-21-2017 11:36 PM
are you referring to the discovery process in APIC-EM or is it a different app ?
I tried using the same however zero devices detected, Meanwhile I am reconfirming the policy in FW for discovery purposed port opened or not.
09-21-2017 11:40 PM
That is the one.
Can you ssh to the devices from APIC-EM?
Also need SNMP read only.
09-23-2017 04:42 AM
Phani,
If there is no single "seed" device which sees any other on CDP and every device is in separate subnet you probably cannot. Do you have any other network gear behind that WAN router which needs to be discovered?
In that case creation discovery job for each site sounds like good idea.
Hint: don't do it manually, this is definitely something which should be done by script via API.
Misha
09-23-2017 06:37 AM
Misha,
Thanks for the suggestions, there is no devices which as seeds of CDP, I understand we need to discover site wise , Is there any option to upload the device list rather adding manually,
Could suggest for API if any ?
Thanks
Phani
09-25-2017 05:58 AM
Hi Phani,
I created a PowerShell and python scripts to run a discovery from an input file - https://github.com/ymeloch/APIC-EM
Hope you'll find it useful.
Regards,
Yossi
09-28-2017 10:54 AM
Hi Yossi ,
Let me try powersheel LA& get back to you. Thanks for the scripts
thanks
Phani
09-25-2017 12:47 AM
Phani,
API is https://<APIC-EM>/api/v1/discovery
It requires InventoryRequest to be posted - see complete one on swagger. Not all the fields are mandatory.
I've got away with following (Warning: Javascript).
Please note IDs from globalCredentialIdList are relative only to my system. queryAPI is simple function which executes actual API call.
function create_one_discovery (token,ip) {
var requestBody = {
"name": "dis_" + ip,
"discoveryType": "CDP",
"cdpLevel": 3,
"protocolOrder": "ssh,telnet",
"timeOut": 5,
"retryCount": 3,
"isAutoCdp": true,
"globalCredentialIdList": [
"67664efa-083c-4af8-ace4-03bc499be540",
"72e6e95a-1142-4893-bae7-bdf8ac1c2959",
"f4ee8f3a-b308-4c05-9cba-c21788ba2c8e",
"0cfe3bbf-9267-434e-9e58-a74fb77bbad5",
"ec4f510d-b5e3-4520-82df-2a860e238343",
"b1b2b6bb-3049-46cc-947f-cf16098e8a01"],
"ipAddressList": ip
}
var options = {
method: 'POST',
uri: 'https://'+ config.apicem + '/api/v1/discovery',
body: requestBody,
headers: {
'Content-Type' : 'application/json',
'X-Auth-Token' : token
},
json: true, // Automatically stringifies the body to JSON
strictSSL: false,
resolveWithFullResponse: false //
};
return queryAPI(options)
}
When I have time to finish it would have simple web interface to create discoveries from list of IP.
Misha
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide