<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: API - LLDP / CDP for every port for every device in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416865#M2922</link>
    <description>&lt;P&gt;Not unless you're using multithreading or some other concurrent processing method. Meraki API calls take 2-5 seconds to return usually. One script running sequentially will never be able to exceed the 5calls/second limit. &lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2019 19:18:16 GMT</pubDate>
    <dc:creator>jdsilva</dc:creator>
    <dc:date>2019-04-05T19:18:16Z</dc:date>
    <item>
      <title>API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416861#M2918</link>
      <description>&lt;P&gt;Hi there , &lt;/P&gt;&lt;P&gt;I'm currently trying to something to get every switch port configuration and every LLDP / CDP device on every switch port.&lt;/P&gt;&lt;P&gt;The issue I'm looking at , is that I have to do a call for every device we have. &lt;/P&gt;&lt;P&gt;ex: &lt;/P&gt;&lt;PRE&gt;GET /networks/[networkId]/devices/[serial]/lldp_cdp&lt;/PRE&gt;&lt;P&gt;and : &lt;/P&gt;&lt;PRE&gt;GET /devices/[serial]/switchPorts&lt;/PRE&gt;&lt;P&gt;I have to identify every single AP that is misconfigured ( like an AP seen on access port. &lt;/P&gt;&lt;P&gt;We have over 2500 device so I really need to script that. &lt;/P&gt;&lt;P&gt;Anyone done something similar ? &lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 17:14:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416861#M2918</guid>
      <dc:creator>Raphael_L</dc:creator>
      <dc:date>2019-04-05T17:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416862#M2919</link>
      <description>&lt;P&gt;I would probably attack this using the Org Inventory call, and then iterate though those results to get LLDP/CDP and switchport info for every device whose model starts with MS&lt;/P&gt;&lt;P&gt;So something like this in pseudocode:&lt;/P&gt;&lt;PRE&gt;devices = get /organizations/[id]/inventory

for dev in devices
    if dev[model] starts with "MS"
        cdp-lldp = get /networks/dev[networkId]/devices/dev[serial]/lldp_cdp
        lastport = dev[model[6:] #slice the model number to get number of ports
        for portnumber in range(0 to lastport)
            switchport[portnumber] = get /devices/[serial]/switchPorts/[portnumber]

print cdp-lldp
print switchport&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Apr 2019 17:43:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416862#M2919</guid>
      <dc:creator>jdsilva</dc:creator>
      <dc:date>2019-04-05T17:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416863#M2920</link>
      <description>&lt;P&gt;I've been working on an easy way to pull CDP info, esp since the API seems like the only way to get it out of an MX. My goal was to be able to pick an org, pull its network list, then granularly work network-&amp;gt;device category-&amp;gt;device (or whole hog) to get specific info. &lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm doing this in Python. I convert the dictionaries into objects using classes, because I find it easier than trying to dig into some of the weirdly formatted JSON.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I don't have anything that's not weirdly broken to share, unfortunately.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Final product is a &lt;/SPAN&gt;&lt;SPAN&gt;CSV or xlsx containing:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Org name (if multiple orgs), network name, device name, all switchports (in your use case), all results of CDP/LLDP&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Pseudocode:    &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Pull org list&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for org in orgList:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    get networkList from org&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;        for network in networkList:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;            get deviceList from network&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                for device in DeviceList:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                    if the first two letters in the device.name == MS:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                        get switchports&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                        get CDP/LLDP information for that device&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                        do some magic to ensure switchports are correlated to CDP/LLDP info&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;                        output switchports and CDP/LLDP info into a CSV or Excel spreadsheet&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If all of your APs are Meraki APs, you could instead check device.name == MR, then get CDP/LLDP info off the AP itself.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Apr 2019 18:07:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416863#M2920</guid>
      <dc:creator>Nash</dc:creator>
      <dc:date>2019-04-05T18:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416864#M2921</link>
      <description>&lt;P&gt;Thanks for the pseudo code. I'm almost done , but I have one last concern. &lt;/P&gt;&lt;P&gt;Since I will have to retrieve info from over 2500 devices , it looks like I'm going to be bottlenecked by the 5 calls / sec limit , ain't that right ?&lt;/P&gt;&lt;P&gt;- Raphael&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 19:15:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416864#M2921</guid>
      <dc:creator>Raphael_L</dc:creator>
      <dc:date>2019-04-05T19:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416865#M2922</link>
      <description>&lt;P&gt;Not unless you're using multithreading or some other concurrent processing method. Meraki API calls take 2-5 seconds to return usually. One script running sequentially will never be able to exceed the 5calls/second limit. &lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 19:18:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416865#M2922</guid>
      <dc:creator>jdsilva</dc:creator>
      <dc:date>2019-04-05T19:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416866#M2923</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;Since I will have to retrieve info from over 2500 devices , it looks like I'm going to be bottlenecked by the 5 calls / sec limit , ain't that right ?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Correct.  But even if you only do 1 device a second you'll be done in an hour - so no big deal.  Even if it takes 8 hours you can just leave it running over night and you'll have your answers in the morning when you come into work.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 21:26:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416866#M2923</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2019-04-05T21:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416867#M2924</link>
      <description>&lt;P&gt;So I'm done with my script ! I can now identify any device via LLDP that as AP in it's name and identify if it's port is either in access or trunk. If it is in access , it is flagged as misconfigured.&lt;/P&gt;&lt;P&gt;If you guys need it I can share my code ( only have to adapt your key ,orgID,  and the output messages ( currently in french ) &lt;/P&gt;&lt;P&gt;Last question :  I'm looking for the equivalent of : &lt;/P&gt;&lt;PRE&gt;GET /devices/[serial]/switchPorts&lt;/PRE&gt;&lt;P&gt;but for MX ( not MS ). I don't see anything. I would like to be able to identify misused ports on MX. &lt;/P&gt;&lt;P&gt;Going to make a wish if this feature is not already there.&lt;/P&gt;&lt;P&gt;Thanks a lot &lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2019 00:55:37 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416867#M2924</guid>
      <dc:creator>Raphael_L</dc:creator>
      <dc:date>2019-04-07T00:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416868#M2925</link>
      <description>&lt;P&gt;Hey &lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/13291"&gt;@Raphletourn&lt;/A&gt; can you share your script?  Trying to do something similar.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 01:20:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416868#M2925</guid>
      <dc:creator>ryfirth</dc:creator>
      <dc:date>2019-09-30T01:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416869#M2926</link>
      <description>&lt;P&gt;Sure ! &lt;/P&gt;&lt;P&gt;Here it is &lt;/P&gt;&lt;DIV class="lia-spoiler-container"&gt;&lt;A class="lia-spoiler-link" href="#" rel="nofollow noopener noreferrer"&gt;Spoiler&lt;/A&gt;&lt;NOSCRIPT&gt; (Highlight to read)&lt;/NOSCRIPT&gt;&lt;DIV class="lia-spoiler-border"&gt;&lt;DIV class="lia-spoiler-content"&gt;&lt;P&gt;import json&lt;BR /&gt;from meraki import meraki&lt;/P&gt;&lt;P&gt;apikey = "" #YOUR KEY&lt;BR /&gt;orgid = "" #YOUR ORG ID&lt;/P&gt;&lt;P&gt;Inventaire = meraki.getorginventory(apikey,orgid)&lt;/P&gt;&lt;P&gt;for switch in Inventaire:&lt;BR /&gt;if switch['networkId'] is not None: &lt;BR /&gt;lldp = meraki.getlldplldp(apikey, switch['networkId'] , switch['serial'])&lt;BR /&gt;try:&lt;BR /&gt;for portID in lldp['ports']:&lt;BR /&gt;try:&lt;BR /&gt;if "AP" in lldp['ports'][portID]['lldp']['systemName']:&lt;BR /&gt;#checking if AP is in the lldp info , we named our AP like that&lt;BR /&gt;portdetail = meraki.getswitchportdetail(apikey, switch['serial'] , portID)&lt;BR /&gt;if portdetail['type'] == "access":&lt;BR /&gt;config = "Port {} de la switch {} est mal configuré pour la borne {}.\n".format(portID, switch['name'], lldp['ports'][portID]['lldp']['systemName'] )&lt;BR /&gt;&lt;BR /&gt;f = open("OP_portAP.txt", "a")&lt;BR /&gt;f.write(config)&lt;BR /&gt;f.close()&lt;BR /&gt;except:&lt;BR /&gt;erreur = "no ports"&lt;BR /&gt;except:&lt;BR /&gt;erreur = "no lldp"&lt;/P&gt;&lt;/DIV&gt;&lt;NOSCRIPT&gt;&lt;DIV class="lia-spoiler-noscript-container"&gt;&lt;DIV class="lia-spoiler-noscript-content"&gt;import jsonfrom meraki import merakiapikey = "" #YOUR KEYorgid = "" #YOUR ORG IDInventaire = meraki.getorginventory(apikey,orgid)for switch in Inventaire:if switch['networkId'] is not None: lldp = meraki.getlldplldp(apikey, switch['networkId'] , switch['serial'])try:for portID in lldp['ports']:try:if "AP" in lldp['ports'][portID]['lldp']['systemName']:#checking if AP is in the lldp info , we named our AP like thatportdetail = meraki.getswitchportdetail(apikey, switch['serial'] , portID)if portdetail['type'] == "access":config = "Port {} de la switch {} est mal configuré pour la borne {}.\n".format(portID, switch['name'], lldp['ports'][portID]['lldp']['systemName'] )f = open("OP_portAP.txt", "a")f.write(config)f.close()except:erreur = "no ports"except:erreur = "no lldp"&lt;/DIV&gt;&lt;/DIV&gt;&lt;/NOSCRIPT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;You might want to adjust some parts in the script , but the logic is there,&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 17:19:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416869#M2926</guid>
      <dc:creator>Raphael_L</dc:creator>
      <dc:date>2019-10-03T17:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416870#M2927</link>
      <description>Awesome, thanks! Will give that a shot.</description>
      <pubDate>Thu, 03 Oct 2019 17:29:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416870#M2927</guid>
      <dc:creator>ryfirth</dc:creator>
      <dc:date>2019-10-03T17:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416871#M2928</link>
      <description>&lt;P&gt;Take a look here, you may find some code to build your own solution:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.cisco.com/codeexchange/github/repo/routetonull/getMerakiNeighbor" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/codeexchange/github/repo/routetonull/getMerakiNeighbor&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 16:40:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416871#M2928</guid>
      <dc:creator>Gian Paolo</dc:creator>
      <dc:date>2019-12-15T16:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: API - LLDP / CDP for every port for every device</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416872#M2929</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Thanks for the topic&lt;BR /&gt;that's solve my mistake to extract Meraki CDP/LLDPinformations to my IPAM Netbox by API&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Feb 2025 08:00:50 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-lldp-cdp-for-every-port-for-every-device/m-p/5416872#M2929</guid>
      <dc:creator>guillaumearibaud</dc:creator>
      <dc:date>2025-02-28T08:00:50Z</dc:date>
    </item>
  </channel>
</rss>

