It's my aim to make you the best network engineer that you can be in this video I'm going to show you
three ways to run scripts on Cisco devices.
In other words run them on box.
You don't need Python to run these scripting options.
They've been around in the Cisco IOW for many many years.
I'm going to show you how to use tickle or TTL scripts.
I'm going to show you how to use the embedded event manager.
And I'm going to show you how to use Linux scripts directly on Cisco devices.
Again you don't need Python to run these scripts.
You don't need a separate VM or a separate shell.
You can run these directly on Cisco IOW.
So in the same place where you type confetti or enable you'll be able to run these scripts
I want you to be the best network engineer in your organization.
I want you to go to interviews and blow away people with your knowledge and skills when a senior network
engineer looks at what you're doing.
Surprise them with the knowledge that you have now a favor from you.
If you enjoy this video please like it.
And please subscribe to my youtube channel if you enjoy these videos.
Click on the bell to get notifications when I post a new video.
Now with that being said let me show you how you can do really cool things on Cisco Iris devices.
In this example I'm using genius 3.
I'm not using a special version of Cisco IOW I'm just using traditional Cisco IOW devices here.
OK.
So the first scripting option is using tickle or TCO scripts.
This document was updated in 2011.
In other words this has been around for a long time.
The next one is the Iaw embedded event manager.
This has also been around for a long time.
And then I'm going to show you the Cisco Iowa shuffle.
I've shown you this in other videos but I want to show you some scripting options using the Cisco Iowa
show.
Okay so let's start with tickle or TTL.
Now you're going to run this in enable mode on a Cisco device in my genius free topology.
He has wrote a one.
I've got Rod a two Rod three.
These are all Cisco I V devices.
So if I touch your version here.
Notice the Iaw.
This is the version of ISIS.
There's nothing special about this.
This is just standard Cisco IOW OK.
So TCO a sage.
Notice the mode that we're in.
Whole bunch of commands are available here but what we're going to do is we're going to create a full
loop so for each.
And you can call this anything IP address the variable whatever you like notice the brackets.
So for each value here we are going to ping the variable IP address.
So I'm going to copy that onto the Cisco device.
Now don't need to be in this mode.
So I'm gonna say TTL quit to quit out of a little TCO and I'm in a piece to the scene.
Notice what happens when I press enter now the router pings those four IP addresses in the list.
Now this is a very basic script.
I mean what I could do here is at a whole bunch of additional IP addresses.
But what I'll do is I'll simply add back duplicates of some of the IP addresses so I'll copy that
credit here and paste that in and that wouldn't very quickly but notice they have pasted the script
in and what it's doing now is it's pinging every one of those IP addresses as well as the additional
IP addresses that I specified.
So let's do TTL quick there.
Now that's okay but you don't necessarily want to have to paste that in every time.
But if you're just doing some work on a device and you want to test IP connectivity to multiple devices
you can do that a lot of CCI candidates use this for testing connectivity and they CCI labs now what
I've also got she has a Windows.
P.S. This is a Windows 10 computer and I'm running the solar winds TFT server on this computer.
You can download the solar winds t FTB server for free using the link below.
It's free software that you can download and use.
And what I've got here in the TFT root directory is a tickle script.
Okay so here's our script.
I'll make the font a bit bigger so it's easier to read.
But essentially it's the same option as we had before.
I've just got a tab between all the IP addresses.
So basically the same type of script.
But what I can do now is copy that to the flash of the router.
So what's the IP address of this.
It's 10 dot 1 dot wondered 1 to 1 the name of the file is ping dot tickle or pinged or TCO.
It's up to you which way you want to pronounce that so back on my router D.R. shows us that that file
doesn't exist in Flash.
Let's make sure that we can ping the T FTB server I can copy TFT P Flash 10 1 1 1 2 1 is the TFT B server
ip address pinged tickle or ping got C TTL is the file name.
I'm going to copy that too flash that's now copied across it is copied successfully deal ah shows us
that that file is in flash what you can do now is simply use this command.
So TTL this H and the name of your script in Flash.
So on my rota TCO is H.
You may want to do it this way
and notice that you go or just do TTL S H and the name of the file in Flash.
And then you go once again.
So you could put a file like this in the flash of a device.
You can actually call it directly from a TV server if you want to you don't have to run it in Flash.
But I did in this example and notice that script now pings all the devices I could use more to look
at my script.
So notice there's the script once again.
All it's doing is running TCI less each for each IP address in this list here.
Notice the brackets once again it's going to ping the IP addresses in that list.
OK.
So that's a very basic example of tickle or TTL if you want to get more information.
Have a look at this configuration guide.
I've put a link below this video if you want to have a look at this and get more information you can
do various things with this but I think the most useful basic option so the low hanging fruit as they
would say is to simply use it to ping multiple devices in your network.
Very basic script.
Okay so that's TTL or tickle.
The next one is the Cisco Iris embedded event manager.
Let's have a look at that.
Once again there's a lot of documentation on Cisco's Web site.
They've got links for real time network event detection and more writing policy using command line interface
etc. But I'm going to show you a fairly simple example to get you started.
What I've got here is a script that says event manager applet given a name.
So in this example I'm looking for interface gigabit 00 going down basically what it's doing is it's
looking for the statement in such log so it's looking for a source log message like that.
As an example on my router if I go on to interface gigabit 00 and I shut that interface.
Notice we'll see that statement in the output right over there.
Interface has gone down.
Now you could look for different events so always SPF neighbor relationship going down or something
else happening.
You can use this to send you an email if something happens in your network.
I'm starting with a basic example here.
Let me know if you're interested in more detailed or more complex examples.
But basically what we gonna do is look for an event and then we've got a time period and different actions.
Action one two three four five and six.
And what we're going to do is run CLIA commands.
Don't forget to use enable as your first command then comity.
Then we're going to go into that interface gigabit 00 and then we're going to shut it down and no shut
it.
And then we're going to write a slog message saying interface when done.
You could put any kind of message there that you wanted to but let's copy that and again I'll put the
script below the video so that you can copy it and use it yourself.
Use all of these at your own risk but I've tested this and I'll show you right now that it does work.
So I'll go into global configuration mode and I'll paste that script in.
So notice in global config mode event manager applet interface goes down.
Now notice what happens.
Interface gigabit 00 I'm going to shut it down.
So interface has gone down but notice suddenly interface has come up again.
Notice the special message here gigabit 00 went down.
And if I type do show the interface brief notice interface is up up so show run.
Have a look at that running config
right at the bottom here.
Notice he has my event manager.
I could change that as an example I could say what's going on gigabit 0 0 went down.
Let's do that.
Copy that in the global config mode question mark will give you problems so let's do that manually and
I'll show you another trick when it comes to question marks.
So let's do this.
Paste that in press control the question mark.
Now I can actually add a question mark.
So on Cisco IOW if you need to add a question mark somewhere you'd control the to allow you to edit
so paste the rest of that day and I should be in the right mode.
So event managers my mode Let's paste that back it's accepted that and all I need to do is end my script.
Okay.
So show IP interface brief interface is currently up up but I'll go on to the interface and shut it.
So I've manually shut the interface down.
Notice we see our message.
What's going on.
Interface went down.
Notice interface goes down.
But the interface comes up again.
Interface has come up do show IP interface brief interfaces back to being up up.
Okay.
We've also got debug.
So before I wrap this up let's have a look at these bugs.
So what I'll do is enable that debugging.
So E.M. debugging is on go onto the interface and shut it.
And hopefully what we'll see now is the commands will run.
And there you go.
Okay.
Going up lot of output.
Yeah let's make that bigger.
Shut the interface down.
Notice the interface change stated miserably down CLIA open was cold.
So this script was called some of the information is displayed because we've opened up a t t y line
or a connection to the device.
You see this when you Telnet to Oasis H to a Cisco Iowa's V device.
But notice the important part is here.
Out Right a one we sent the command enable out write a one privilege mode.
We've sent the command config terminal.
This is what's displayed down in global config mode.
We sent the command interface gigabit 00.
That's the mode we've shut the interface down.
We've no shut the interface.
We've displayed a message and the script has now ended and now the interface has come up again to show
IP interface brief notice.
The interface is up up.
So basic example of a event manager applet showed you that with the debug.
So that was a very basic example of using the Cisco ISC embedded event manager.
Want to get you started.
You can have a look at this document for more information.
There's plenty of options.
You could look for OSP if neighbor relationships going down and then you can get it to send you an email
as an example if you want to do that.
Lots of options available here but that's a good one to get you started.
Okay.
The next one is the Cisco Iowa shell.
This allows you to use Linux commands directly on the Cisco IOW he has a very basic one for x in one
two three.
Do something.
What are we going to do we gonna ping this variable X which would be one two or three and then the script
is done so let's try that on write a 1 his right of 1 again
for this to work.
I have to enable shell processing full so either globally on the rod or switch or I can do it on a per
session basis by using that command.
So you don't need to do both.
This will just enable it on the local telnet or SSA or console line until you've finished.
In other words till you exit out then it'll stop running.
This enables the function all the time.
So basically this enables Linux commands on the rod or switch.
So 4 x in 1 2 3.
What are we going to do.
We going to paying 10 1 1 X done and notice it now pings those IP addresses so paying 10 1 1 1 paying
10 1 1 2 times out there because of all and pinged 10 1 1 3.
So we've now pinged 3 IP addresses now at the moment.
Show shelf functions shows us that there are no user defined functions.
We've only got built in functions so bolting functions are what's enabled when you type that command
terminals shell as an example.
So we could do things such as show run grep face.
In other words you use Linux commands directly on the Cisco.
IOW what we can do is create our own user defined functions.
So what I'm going to do is paste that scripting.
Basically we've created a function called Test ping.
If I remove that just to show you this I'm going to remove that function.
And now when I try and use the command test ping it doesn't work.
Command doesn't work but when I paste that in now and I use the command test ping notice it works because
I've created this user defined function.
Notice the brackets.
This is a function and what we're doing here is running for commands.
So like pinging different devices you could do something like
function echo if you like.
So just get it to echo something.
This is not doing much except printing stuff to the screen.
But the point is is that you can create your own functions that can do things.
So notice now when I type test echo it just echoes those values back.
It doesn't really do anything test ping is probably more valuable to us so show shall function now shows
us that we've got these user defined functions.
Notice.
Function test echo function test.
Ping.
Okay so I think that's enough.
This video is getting really long but that gives you an idea of what's possible using the Cisco.
IOW remember we didn't have to run Python here we didn't have to drop down to Olynyk shall we didn't
have to use a Linux VM.
We ran these commands directly on the Cisco IOW go out there and show people how much you know go and
surprise them and amaze them with your knowledge of the Cisco.
IOW I'm going to continue in the series teaching you options that not everyone knows so that you can
be a so-called boss on the Cisco IAW or like a really cool network engineer.
Now please if you've enjoyed this video please like it.
And please subscribe to my YouTube channel.
Click on the bell to get notifications so that you know when I upload a new video I'm David Bumble.
Want to wish you all the very best.