November 09, 2011
Posted by: gdelmatto : Category:
Cisco,
TCL
Being used to other languages sometime leads to false assumptions, like having the same commands every now and then.
While doing some TCL scripting on a Cisco I just had the need for a ‘sleep’ command or equivalent.
Since no ‘sleep’ exists, the ‘after’ command will do. Just supply it with the timeout in milliseconds, like this for a 10-second timeout:
after 10000
Or, with a bit more overhead, but some may think it’s more readable:
after [expr {int(10 * 1000)}]
November 02, 2011
Posted by: gdelmatto : Category:
Cisco,
Networking,
Perl,
Programming
Here’s a short script which I use to extract Cisco device-types from SNMP.
Bad enough, most of these devices return their device type ID differently, e.g. sometimes prefixed with an uppercase ‘C’, sometimes without any prefix, then again sometimes we find a suffix.
So here’s a snippet, that makes them look neat, so I can work with simple and unified looking device IDs.
Read more…
July 14, 2011
Posted by: gdelmatto : Category:
Cisco,
Networking,
Programming,
RegExp
A project I’m currently working on involges much Regurlar Expressions trickery to parse values from Cisco’s running configuration.
Here’s how to extract a complete interface block not in ‘shutdown’ state.
Read more…