So now let's briefly change gears and talk about something known as EEM.
Now what this stands for is Cisco's Embedded Events Manager.
Now in essence EEM can be implemented in two different ways.
We can have something known as an applet and we can also have EEM scripts.
Now for our purposes the one we have to focus in on is the applets.
Now the good news is is that this is the simpler implementation.
Now basically what we're talking about here is when some type of event happens WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now basically what we're talking about here is when some type of event happens
on your system.
You have this type of F style logic, this programmatic logic.
If something happens, if an event happens then we want to perform a particular
action in response.
Now when we happen to create an EEM applet the actual response we specify is
just well
specified directly via the CLI whereas if we want to create an EEM script then
we create
something known as a TCL script. Again we don't have to focus on this so let's
just stick with
the applet via the CLI. So what type of thing could this be? Well let's maybe WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the applet via the CLI. So what type of thing could this be? Well let's maybe
say we have,
let's go with a router here and a router here, this can be R1, this can be R2.
Let's suppose we happen to have some type of BGP peering across to this device
here.
So it's going to be BGP neighbour 2.2.2.2 and 1.1.1.1.
Now say for example the connection here happens to flap and we get a syslog
message on our device
denoting and telling us that well our adjacency with 2.2.2.2 has ultimately
went down with WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
went down with
loss that connection then in response perhaps we would like to issue the
commands clear IP BGP
soft which is simply a command we can use to reconfigure and activate BGP
information within
our devices. So again think about R1, R2. If we happen to have a problem with
this neighbour
relationship that happens to go down and respond to this happening before we
even have to look at it
or notice it or type anything in response to this particular action our EEA app
let can be programmed WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
let can be programmed
to look for it and then respond accordingly by issuing this clear IP BGP soft
commands.
So we get that in sync kick in similarly let's maybe say someone happens to
administratively shut
down this link well what we could do is if we notice that link going down we
can have an EEA
applet to respond accordingly to that particular action and then bounce that
interface back into
the upstate. This is really all we're talking about here we're noticing events
and in response
to particular events we're going to be performing particular actions in this WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to particular events we're going to be performing particular actions in this
nice automatic form.
So let's go and see how this actually does operate there okay so what we'll do
is go to the
definite sandbox. So what I've done is log into a switch and what I'm going to
do is I'm going
to make configuration changes which will ultimately generate logs I will then
use those logs as a
pattern to match in order to invoke my EEA applets let me show you what I mean.
Say for example I
created a look back interface of look back let's go with 132 okay does it
actually matter the name WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
actually matter the name
what we can actually see here straight away is the creation of that look back
generated this
message now if I happen to shut this down look at what we actually see here see
this interface look
back 132 is down say for example I just copy this right here okay now here's
what I'm going to do
for the moment let me just say no shut so it's back up in the upstate what I
will do in fact what I
will do is I will say interface look back 132 and let me just put an IP address
of 192.168
132.132 and give it a slash 32 mask okay and just say look back for IBGP pe WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
132.132 and give it a slash 32 mask okay and just say look back for IBGP pe
ering okay let's say
this is the purpose of this particular look back okay so here's what I'm going
to do as we can see
if I go to show IP interface brief right now the protocol is in the upstate and
as such what that
means is that it can ultimately ping this address I can say do ping 192.168 132
.132 as we can see
right here now I will configure my EEM applets I'll say event manager applets WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
right here now I will configure my EEM applets I'll say event manager applets
that is the type
we're going to be using and now I just give this applet a name let's just call
this look back up okay
now I'm inside the configuration what I will do is I will say event syslog
pattern and then
with think rotation marks I'm going to tell the system which pattern to look
for so what I will
do is I'll tell the system if you happen to see this particular pattern that
look back 132 is down
what I want to do is to perform a particular action so I'll say action and I'll WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
what I want to do is to perform a particular action so I'll say action and I'll
give this
in the medical value this can be action 1.0 and I'll say it's a CLI command I
want to be doing
so now specify the command will be enable I'll then say the next command this
will be
command 1.2 this will be configure terminal it will be to go into that
interface so I'll say interface
look back 132 and then the next command will be action at 1.3 and that command
will simply be
to type no shutdown so if I just do end that is now configured that applet so
here's what's going WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
here's what's going
to happen like I say right now if I do show IP interface brief we can see we
are in the upstate
for interface look back 132 now if I go into that look back right here and I
happen to shut it down
we're going to generate that logging message which is ultimately going to kick
off these particular
commands see how the interface is suddenly straight back up that is because
this particular pattern
set off the applet to go and kick off all of those commands I specified see the
ones above enable
configure terminal interface look back 1.3 and then the no shutdown command so WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
configure terminal interface look back 1.3 and then the no shutdown command so
if something happens to
go in and you know erroneously pull down or look back that we're using for bgp
then automatically
pre-configured we're going to have EEM in order to save us