Alrighty friends, let's talk about the answers. So the first question we have
been asked
that many of the devices in our network are very old, can we still automate
them?
Well, as I hope we've learned within this particular skill, we are not limited
by having
old devices. In fact, so long as these old, dusty devices can be managed
remotely via SSH,
then you can utilize particular tools such as NetMico to basically log in
remotely and run all the
commands that you need just in a programmatic manner. So the first answer to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
commands that you need just in a programmatic manner. So the first answer to
this question is
they resounding yes, don't let all devices put you off, automation is still
possible. Okay,
next one, we have over 100 devices in our network. Is this going to present a
problem? Can we connect
to them all? Well, is this going to present a problem? Certainly not. 100
devices, not a big issue
at all. Now how can we connect to the mobile? Technically what you could do is
you could write the
connection details for every single one of your 100 devices, every single 10
year rate a script,
and just bait the details directly into the script. Now you may be thinking WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and just bait the details directly into the script. Now you may be thinking
this is not a good idea.
And if that is your intuition, then you certainly would be correct. Remember
what we did in this
particular skill. Instead, we simply wrote the connection details for all of
our devices, which in
this case here would be 100 a little bit more than four, but nevertheless we
could write them into
a YAML file and we only need to write that information once and then in the
future for every single time
you want to run a script, we can just add in very simple logic to read in the WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
you want to run a script, we can just add in very simple logic to read in the
information from this
particular file, utilizing say, for example, the PI YAML library. And after
that, what can we do? We can
utilize things such as loops to iterate through each element within that object
and then connect
your devices sequentially one by one by one. I will say for posterity, if you
get a little bit more
familiar with Python, you can actually do some cool things such as threading,
which is essentially
going to allow you to connect to all 100 devices at the same time as opposed to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
going to allow you to connect to all 100 devices at the same time as opposed to
one by one by one by one
in a regular Python loop. But forget about that for now, that's way beyond what
we're talking about.
Quite simply, if you're just beginning to automate with only 100 devices, a
Python loop is probably
a perfectly reasonable option, albeit perhaps not the most efficient solution
but never mind that, okay?
If you suggested a Python loop, then in my book you still get all the points.
Okay, so the next part,
they ask, will we be able to make configuration changes or just run show
commands? Well, in the case of
NetMico, we know we can use the send command methods, which is going to allow WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
NetMico, we know we can use the send command methods, which is going to allow
us to send show commands
to our devices. Okay, so that sounds pretty good, but what about making
configuration changes? Well,
as we know, NetMico also has another method known as the send config set method
, and this is going to
allow us to send actual configuration. So what we could do is we could have our
configurations in some
type of text file, and then we can read in those configurations using the open
function and then
break it down line by line by utilizing the read lines methods, and then we can WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
break it down line by line by utilizing the read lines methods, and then we can
take this data and
pass into NetMico's send config set to make the actual configuration changes.
So the last one,
the big boss has heard about network testing. They're asking is this possible?
How can we implement this?
Well, similar to what we just saw before we know NetMico can send show commands
, but in the case of
our old devices, this is going to return just regular string data, but what we
can do is we can
utilize tools such as text, FSN with NetMico, and this can basically transform
our regular CLI text WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
into structured data, whereby we can parse it and then implement Pythonic logic
to effectively
conduct particular tests. You know, is our NTP server matching what we expect?
Are our OSPF
neighbors in the full state that type of thing? Really, when it comes to
network testing,
as long as you have your data coming back to you as structured data, then the
only real limits are
your imagination, anything you can think of, you can pretty much implement. So
friends, that is us
for our validation challenge on writing Python scripts for network automation. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
for our validation challenge on writing Python scripts for network automation.
I hope it's been
in the form of 'to for you', and I'd like to thank you for viewing.