I am trying to write a tool that gathers STP information from the Cisco devices in my network. I started by gathering data via SNMP but have run into performance problems with devices that have many VLANs configured on them. So I've resorted to CLI scraping.
My current problem is the number of variations to get STP information via CLI on my IOS devices.
On some devices, I need to issue the command "show spanning-tree". On others, I need to issue "show spanning-tree detail" in order to get the same output. On still others, I need to issue "show spanning-tree vlan [x]" for each vlan in order to get all the data.
Right now, I've got the command needed hardcoded for each of the devices but I'd like to get the correct command to issue from a matrix (based on sysoid and IOS version perhaps?).
Can anyone point me in the direction of documentation that explains when it is correct to add "detail" to the command and when it is correct to iterate per vlan?