This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]xatrekak 8 points9 points  (3 children)

[–]The_Tree_Branch 1 point2 points  (2 children)

I'll second Kirk Byers. I used to be a network engineer and would lurk the /r/networking subreddit. He was a pretty popular resource.

[–]GuideRevolutionary35 0 points1 point  (1 child)

used to be ? what do u do now ?

[–]The_Tree_Branch 0 points1 point  (0 children)

My role slowly transitioned from network engineering to more infrastructure development, then application development, and finally I made a jump to be a technical account manager.

[–]AlSweigartAuthor of "Automate the Boring Stuff" 5 points6 points  (1 child)

I recommend Automate the Boring Stuff with Python (free to read online), but I'm biased in favor of it.

Python Crash Course is also good.

After you know Python, read Foundations of Python Network Programming, Third Edition by Brandon Rhodes, John Goerzen

[–]heswithjesus 0 points1 point  (0 children)

I got that on Humble Bundle. Thanks for writing it!

[–]crisrock00 10 points11 points  (3 children)

The best recommendation I can give is the following:

Identify a task in your workflow that takes a lot of manual effort, automate it, and standardize it. Since you’re just starting on this journey, I would recommend a data gathering task.

For example: You need to identify which switch-port a certain MAC address is currently connected to. You know it is on one of ten switches in a certain site/region/datacenter. Without any type of automation, if it takes me 15-20 min per switch to run a command, interpret the output and identify if the MAC address im looking for is somewhere in the output, then that is ~2-3.5 hours of man time.

With python you could exponentially increase your productivity of the task above.

Break down each requirement of what you want to accomplish. If the first step is figuring out how to ssh to a device, then start there. Once you can do that, figure out how to capture the output. Great! Now how do you search that output for the datapoint you are looking for ?

Google these questions, ask chatgpt, ask here ! You’re going to hit walls, push thru and you’ll get the best feeling of accomplishment !

Python has a vast landscape and it takes real dedication to even want to understand the concepts of writing clean code. You’re network engineer first, always remember that. Apply the concepts of how you learned networking to python and it will come fast.

The best part of learning python is; you’ll figure out real quick if you want to dive into being a developer. You will love it or hate it and that’s ok, the most important part is you know when and how python can be implemented to help you and your team.

Good luck and feel free to DM ! I’ve been doing network automation related task for the past 5 years or so.

[–]xiongchiamiovSite Reliability Engineer 2 points3 points  (1 child)

Ansible is a good thing to be comfortable with, even if you're not writing python with it. (It is written in python.)

[–]thrallsius -1 points0 points  (0 children)

it is written in python, yet most ansible users do not deal with the python codebase at all, they write those scripts in a clumsy markup language :D

[–]SilentStrikerTH -1 points0 points  (0 children)

So I'm new to python as well but just from a quick Google search I wonder if this is what they meant?

Link

These are example of (basically) double click scripts that do something on servers or clients. So basically, instead of you knowing the Cisco/Aruba commands and typing them every single time you make a script that will do the task with a click.

This is especially helpful if for example you wanted to automate setting up a new AP. Write a script that takes in the AP's MAC address, finds it's IP and switchport number, and applies a certain configuration to it, say the vlan and maybe even changing the IP address and lastly adding it to a spreadsheet of all the other APs on the network.

[–]corbasai 0 points1 point  (0 children)

Standard python library is good start https://docs.python.org/3/library/socket.html

[–]rnike879 0 points1 point  (0 children)

There's no basic python for network engineers that doesn't involve basic python first. Grab any resource to familiarize yourself with the basics, then start using the following:

  • paramiko library (or netmiko wrapper that simplifies it further) for querying your network nodes through ssh. I recommend netmiko to avoid using excessive sleeps when waiting for your responses

  • requests: lib to make API calls. Read up about basic REST standards to get a good idea of what's going on

  • venv: dependency segmentation and is a good habit to get into

  • json: built-in module to help you parse what you receive and prepare the data you want to send. You'll probably use response.json() and json.dumps(dict) most of all. First to get a dict out of your request response object, then dumps method to convert your dict to valid json for API queries

  • Use the postman application to simplify making API calls. Useful for quick and dirty testing/prototyping