Switch configuration statistics

Answered Question
Feb 11th, 2010

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?

I have this problem too.
0 votes
Correct Answer by Joe Clarke about 6 years 9 months ago

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Joe Clarke Thu, 02/11/2010 - 09:02

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.

Actions

This Discussion