07-04-2013 09:53 AM - edited 03-07-2019 02:14 PM
hi all,
i'd like to count my "sh ip dhcp binding". how do you count that with result as the count?
thanks!
07-04-2013 11:17 AM
Hi,
would "show ip dhcp pool" show what you're looking for?
Pool MYPOOL :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
Leased addresses : 1
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased addresses
192.168.1.1 192.168.1.1 - 192.168.1.254 1
Hope that helps
Rolf
07-04-2013 01:59 PM
actually this is not the only one i want to count, i just want in general like "sh interfaces status"...
anyway i can grab the logs and paste it on excel...
thanks.
10-30-2013 04:35 AM
try putting "count" before the regual expression, example:
show ip int br | count up
06-04-2019 02:32 AM - edited 06-04-2019 02:33 AM
This should work in IOS and IOS-XE platforms. I use it to try BGP filters.
itesys_gateway#tclsh
itesys_gateway(tcl)#
itesys_gateway(tcl)#proc count {input} { llength [ split [ exec $input] "\n"]}
itesys_gateway(tcl)#count {show ip dhcp binding}
17
ps. watch out for spaces in TCL code!
Gianrico Fichera
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide