cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
591
Views
0
Helpful
2
Replies

Switch configuration statistics

charlie-hall
Level 1
Level 1

I am working on enabling dot1x on switch ports and disabling inactive switch ports on over 350 Switches.

Senior Manager wants a weekly report that shows them statistics by port on were we are at with this project.

I am pretty sure that Cisco Works will not work for this, but I would like to double check.  

I am thinking that we can have the program scan thru all the *.cfg files in a directory

IF Device = switch
   Increment counter "Total Switches"
   IF Interface (except Vlan) = Switch mode access
      Increment counter "Total Access Ports"
      IF (dot1x port-control and shutdown) increment counter "Dot1x Disabled Port"
      Else
      IF (dot1x port-control and NOT shutdown) increment counter "Dot1x Enabled Port"
      Else
      IF (switchport port-security and shutdown) increment counter "Port Security Disabled Port"
      Else
      IF (switchport port-security and NOT shutdown) increment counter "Port Security Enabled Port"
      ELse     
      Exception Display value of Hostname and Interface  (none of the above 4 conditions existed, error)

   Else  (except Vlan)
      Increment counter "Total Trunk Ports"
      If (switchport mode trunk and shutdown) increment counter "Disabled Trunk Port"
      Else
      If (switchport mode trunk and NOT shutdown) increment counter "Enabled Trunk Port"
      EndIF
      Exception Display value of Hostname and Interface  (none of the above 2 conditions existed, error)

Any suggestions?

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

CiscoWorks will not do this for you, no.  You could use the baseline compliance feature to see which ports match certain config patterns, but it would not give you a count like you want.

If you wanted to build your own script to comb through the configs, you could do this using the files in the shadow directory.  Under NMSROOT/files/rme/dcma/shadow/Switches_and_Hubs/PRIMARY you will find configs for each switch.  You could parse them, and build the desired counters.

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

CiscoWorks will not do this for you, no.  You could use the baseline compliance feature to see which ports match certain config patterns, but it would not give you a count like you want.

If you wanted to build your own script to comb through the configs, you could do this using the files in the shadow directory.  Under NMSROOT/files/rme/dcma/shadow/Switches_and_Hubs/PRIMARY you will find configs for each switch.  You could parse them, and build the desired counters.

Thanks Joe for the confirming.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: