jmanteau

Mon coin de toile - A piece of Web

Watch-Like Snippet for Cisco IOS

Posted: Jul 22, 2023

Cisco IOS nowadays have the terminal shell command to allow the execution of basic shell command like grep.

However the watch command is not present. The snippet below allow to reproduce the behaviour of the watch command.

Here I’m checking the recent routes appearing in the vpnv4 family during 60s. You can adjust the 60 parameter if you want to have shorter/longer session.

terminal shell
n=0
while true; do
  let n++
  sleep 1
  show ip bgp vpnv4 all summary | grep ' 00:0'
  if \[\[ $n -le 60 \]\]; then
    echo $n
  else
    break;
  fi
done