01-14-2016 06:13 AM
I am looking for a way to automate a process that will count the number of switch ports that have a Description with a particular string value. I would like to be able to run this against a Device Group of switches.
Scenario: We have a 802.1x switched network and a few ports that are approved to be whitelisted from 802.1x. Management would like to know on a weekly basis, how many of our switch ports are whitelisted. To do this, we add the string "NONAC" to the description field on a interface, like below.
description Server - NONAC
switchport access vlan 500
switchport voice vlan 700
Is there a way to automate counting these interfaces?
Solved! Go to Solution.
01-14-2016 08:01 AM
This is not exactly what you want, I know. To do just what you want you would need to use a script against the API. It would be pretty simple - in fact this one call will return you the count the count of all such ports in device groups 2 and 3:
If you do it in the browser you get XML because of the headers the browser sends. To get JSON you would specify find.json, or it will default to JSON if you are using something like curl.
To get the list of device groups and their IDs:
01-14-2016 08:04 AM
Sorry, it stripped out the xml tags when I sent it via email. That response should be:
<interface>...it also returns one interface which you can ignore...</interface>
01-14-2016 08:27 AM
Thanks. I will give that a try and see what I get. Ultimately, I would like to see a report with the switch name and a list of ports with the matching string and then a summary that shows the totals.