Python for network engineer, how deep?

saddayzsaddayz Member Posts: 29 ■□□□□□□□□□
Hello,

Im Network Engineer and im learning python. It's seems OK, but OOP (objective programming) section drives me crazy.

So my quoestion would be: do the network engineers are required to learn the Pythons OOP ? thank you.

Comments

  • hurricane1091hurricane1091 Member Posts: 919 ■■■■□□□□□□
    I believe this is a skill set that may be needed by network engineers in the future, but not widely required yet. I will be taking a job where they are asking that I learn Python, so take it for what it is worth. They are interested in integrating Puppet into their networking configuration process at a minimum - not sure how Python will come into the equation yet.
  • VeritiesVerities Member Posts: 1,162
    I believe this is a skill set that may be needed by network engineers in the future, but not widely required yet. I will be taking a job where they are asking that I learn Python, so take it for what it is worth. They are interested in integrating Puppet into their networking configuration process at a minimum - not sure how Python will come into the equation yet.

    Python can be used to configure systems, to run reports, etc (your imagination is the limit). Its like I mentioned in your thread the other day, its just another placeholder that people have been using instead of config management software like Puppet, Ansible, Chef, Saltstack, etc. If you can learn Python and use it to make your daily tasks easier, then you are leaps and bounds ahead of your peers.

    Example:

    Worker 1 logs into each system on the network to collect information about running configurations and then uses copy and paste into a text editor.

    Worker 2 creates a script that logs into each system (using a for loop) and collects all that information and places it into a text editor in a nice format, using one command.

    Work smarter, not harder! You can save time which can be quantified into man hours and that translates to $$$ saved. Companies love it when people save them $$$.
  • ccie14023ccie14023 Member Posts: 183
    It is very valuable. You should also study YANG data models and NETCONF.

    A minimal knowledge of OOP is a must. You at least have to be able to use libraries that create objects. Otherwise you can do very little. But full knowledge of how to create and use classes is not needed. That's the nice thing about Python.

    Focus on the basics. Eventually you can expand your knowledge. I agree OOP is confusing.
  • hurricane1091hurricane1091 Member Posts: 919 ■■■■□□□□□□
    Verities wrote: »
    Python can be used to configure systems, to run reports, etc (your imagination is the limit). Its like I mentioned in your thread the other day, its just another placeholder that people have been using instead of config management software like Puppet, Ansible, Chef, Saltstack, etc. If you can learn Python and use it to make your daily tasks easier, then you are leaps and bounds ahead of your peers.

    Example:

    Worker 1 logs into each system on the network to collect information about running configurations and then uses copy and paste into a text editor.

    Worker 2 creates a script that logs into each system (using a for loop) and collects all that information and places it into a text editor in a nice format, using one command.

    Work smarter, not harder! You can save time which can be quantified into man hours and that translates to $$$ saved. Companies love it when people save them $$$.

    So, I somewhat understand you. But then again, I somewhat don't. Example - I use Kiwi Cat Tools all the time. I'll do a "show version" or something on all the routers, and I'll get some output. I'll do a GREP job and get the information I need, and can throw it into excel and easily parse through where all of our routers are at code wise. Is there a better way than doing this? If there is, I am all for it. It would not surprise me if I could write something that got the "show version" and did the GREP work for me. That would be a step up from what I am doing, which is already a step up from manually doing it. Two steps up - nice.
  • VeritiesVerities Member Posts: 1,162
    So, I somewhat understand you. But then again, I somewhat don't. Example - I use Kiwi Cat Tools all the time. I'll do a "show version" or something on all the routers, and I'll get some output. I'll do a GREP job and get the information I need, and can throw it into excel and easily parse through where all of our routers are at code wise. Is there a better way than doing this? If there is, I am all for it. It would not surprise me if I could write something that got the "show version" and did the GREP work for me. That would be a step up from what I am doing, which is already a step up from manually doing it. Two steps up - nice.

    You are right, it looks like Kiwi CatTools is already a step up from the manual process but it is a Windows only application and doesn't appear to be very well known . Python is platform agnostic (you can use it on any OS), extremely popular, and free. Also, you gain deeper technical knowledge when you are able to perform all the functions using scripts rather than relying on a GUI to do it for you.
  • OctalDumpOctalDump Member Posts: 1,722
    You could write something that would not only check the version, but could produce a report (let's say cvs format) that shows just the devices that match a version number, or are below a version number or above it. You could also generate a report that is sorted by version number or other field.

    You could generate a list of devices that are running a particular version, and then run commands against just those devices. You could integrate this check into other code, so for example if the version is this, then run this, if it's above that version do this, if it's below that version do that, and if there's an error getting the version, then log it to this file and continue with the other devices.

    python, like other scripting languages, lets you interact with anything that has a text interface as well as many things that have APIs. You can then automate anything where your decisions are on the basis of text (or API) output and your commands are text (or API) based.

    The question to ask is "is this really better to automate?" Things that are complex, tend to take longer to write, tend to have more bugs, and tend to take more troubleshooting time. It makes doing things to lots of devices more efficient, including breaking multiple devices. If you automate a process and run it against 100 devices, then a bug in the automation might mean you just broke 100 devices. If you do it by hand, then a mistake is likely to affect only one (or a few) devices.

    Sometimes the manual way is quicker and cheaper. But it takes a good amount of experience to get a feel for that.

    As for how deep, well, I would start with a simple problem that you might want to solve, eg get the version number only from a router. Figure out how to do that. That should give you enough basics to then tackle other problems. As you build confidence and knowledge, you can try more difficult things. Basically, you let utility be your guide as to how deep you want to go.
    2017 Goals - Something Cisco, Something Linux, Agile PM
  • powerfoolpowerfool Member Posts: 1,666 ■■■■■■■■□□
    I think that learning Python is a great thng to do. I have been learning C++ and looked for an OpenCourseware course with lectures at the "100" level and came across MIT's 6.00SC course that uses Python. It is a great course and I take the exercises and perform them in C++ afterwards. Another good option would be to perform these same exercises in PowerShell.
    2024 Renew: [ ] AZ-204 [ ] AZ-305 [ ] AZ-400 [ ] AZ-500 [ ] Vault Assoc.
    2024 New: [X] AWS SAP [ ] CKA [ ] Terraform Auth/Ops Pro
  • RogueAdminRogueAdmin Member Posts: 12 ■□□□□□□□□□
    saddayz wrote: »
    . . . do the network engineers are required to learn the Pythons OOP ? thank you.

    *Required*, no.

    Beneficial, yes. As others have inferred, it helps to obtain skills which differentiate you as a professional and job candidate. Continuously expanding your skill set is always helpful, be it for a prospective job or an job you already have (review time!).

    As a network engineer, it is not necessary to be a developer. To get some insight for innovative uses of Python in networking, web search for "python for network engineers". Such as the course outlines for—
    p.s.: Yes, intending to tackle this myself "soon".
  • tunerXtunerX Member Posts: 447 ■■■□□□□□□□
    Scripting and coding for automation of network management and engineering tasks can be beneficial. Each type of language has its own benefits and negatives., but OOP is not a requirement to be a network engineer. If you don't want to do OOP you can work with procedural or functional languages.

    You can work with thirdparty/commercial software like kiwi, solarwinds, SNMPc, RANCID, OpenNMS, etc... Any network management/automation platform can only do so much. When your canned tools do not offer a solution you turn to coding/scripting to accomplish something that your current platforms cannot do.

    I have worked TCL/TK, expect, PERL, shell, BAT, powershell, powercli, VB, C++ and many others. My only goal with coding, as a network engineer, is automation of tasks. I would work with whatever language would get the job done as quickly as possible.
  • aderonaderon Member Posts: 404 ■■■■□□□□□□
    I wouldn't say it's required (at least not from what I've seen in my job market), but it would definitely help you not only at the job itself, but also in the hiring process. It's a way to separate yourself from the average candidate. Also, if you can automate a few things that people have been doing manually for years, they'll think you're the best thing since sliced bread :P

    And I agree, OOP is pretty confusing. But, you can program just fine without it. If you're not in a straight up dev role, you can generally code your programs however you want. I've never heard of a networking position having a programming style guide that mandates you to use OOP. Just a note though, if you were to completely skip OOP, you'll be at a disadvantage reading and using other people's programs when they're using classes and other OOP conventions.
    2019 Certification/Degree Goals: AWS CSA Renewal (In Progress), M.S. Cybersecurity (In Progress), CCNA R&S Renewal (Not Started)
  • kbn0526kbn0526 Member Posts: 6 ■□□□□□□□□□
    If you are interested in learning python Humble book bundle currently has a collection of Python books.

    https://www.humblebundle.com/books/python-book-bundle
Sign In or Register to comment.