Your browser failed to load CSS style sheets. Your browser or web proxy might not support elliptic-curve TLS

Building network automation solutions

6 week online course

Start now!
back to overview

Periodic execution of IOS show commands

If you want to execute IOS show commands periodically (for example, to monitor router status or take snapshots of routing tables), you can combine new output redirection features introduced in IOS release 12.2T in an Embedded Event Manager (EEM) applet. For example, to store the brief interface status into a file on an FTP server, use the following EEM applet:
event manager applet SaveInterfaceStatus
event timer watchdog name SaveIfStat time 60
action 1.0 cli command "show ip interface brief | redirect ftp://username@password:host/path"
action 2.0 syslog msg "Interface status saved"
Notes:
  • The timer watchdog EEM event defines a recurring event triggered every X seconds.
  • Output of a show command can be redirected only to a TFTP or FTP server, redirection to a web (HTTP) server does not work yet.
  • The syslog action is configured for debugging purposes only and can be removed in production environment.
  • More complex functionality (for example, sending show command output in an email) can be implemented with help of Tcl EEM policies

2 comments:

  1. Hi Ivan,

    It seems to me that you might have an error in the syntax of the redirect ftp portion of action 1.0 in this EEM script. As much as I remember it should be something like this instead:

    redirect ftp://username:[email protected]/path

    In any case, you've a great and very useful blog. Keep going!

    Regards.

    AF.

    ReplyDelete
    Replies
    1. You're most probably right ;) Thank you!

      Delete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Sidebar