Options

Python for system Administration?

ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
The thread title says it all :) this is for the gurus of Python programming:

Does anybody use Python for system Administration? mainly from a Linux perspective? I am keen to get my feet wet with Python however first I must consult with the gods of Python and learn some more about this language.

Firstly what version should I be using? I have read articles say version 3 is to new, and the older versions are a no no, so apart from different syntax what the hell is different? and what version should I get a grounding in?

Secondly how does one go about using python to create Linux Administration scripts? does anybody have a resource? does such a thing exist? Or do I have to go through videos of some professor teaching me how to print hello world.

In a ideal world I want to be able to utilize python to create scripts such as firewall configuration, backup, displaying system information, You know with fancy menus / Gui's

Now some would say why don't you use BASH? I already do and want to take it further and learn a bit of Python :)

Thank you for guidance as always
Microsoft's strategy to conquer the I.T industry

" Embrace, evolve, extinguish "

Comments

  • Options
    hiddenknight821hiddenknight821 Member Posts: 1,209 ■■■■■■□□□□
    I recall you created a thread about this not too long ago. You might want to follow up on that. Personally, I believe system administrators use them only as a tool to do the specific tasks, but not necessarily to get most, if not all, things done. Ansible and Salt (SaltStack) are two example of configuration management suites that use Python, and true Linux system administrators use configuration management heavily.

    UPDATE: I want to add that I took a crack at deploying OpenStack from scratch. I've noticed most of the client software used to control various nodes are written in Python. So, this tells me that developers aren't necessarily system administrators and vice versa, but having the best of both worlds is most certainly not a dime a dozen as they're hard to find, which is why people are still saying DevOps is overhyped like virtualization once was.
  • Options
    DoubleNNsDoubleNNs Member Posts: 2,015 ■■■■■□□□□□
    You might want to get good w/ Shell Scripting (bash/sed/awk) 1st before jumping into Python for Sys Admin.
    Goals for 2018:
    Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
    Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
    To-do | In Progress | Completed
  • Options
    YFZbluYFZblu Member Posts: 1,462 ■■■■■■■■□□
    For the most part, you'd just end up using a library like Subprocess to execute Linux shell commands doing things this way. Learn Python, it's a great language; but focus on using the best tool for the job.
  • Options
    ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Will continue with Bash doesn't make sense for me to make the jump yet thought I was missing out on something initially but figured with the Unix toolbox I don't really need Python yet.
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • Options
    UnixGuyUnixGuy Mod Posts: 4,565 Mod
    you can do everything using Bash/shell, so I'd nail that first.

    Then I'd get a Linux sysadmin job and learn whatever tool they're using, and most probably it'll be a configuration management tool like Puppet.
    Certs: GSTRT, GPEN, GCFA, CISM, CRISC, RHCE

    Learn GRC! GRC Mastery : https://grcmastery.com 

  • Options
    ExpectExpect Member Posts: 252 ■■■■□□□□□□
    totally agree with the above comments.

    for Linux administration - Bash all the way.

    once you get a good grip on shell scripting I highly recommend "Python for System Administrators".

    it teaches python fundamentals using Bash samples throughout the book.

    this will easily help you transition from bash to python if you are already used to the way shell scripting works.
  • Options
    DoubleNNsDoubleNNs Member Posts: 2,015 ■■■■■□□□□□
    Expect - should you already know Python basics before reading "Python for System Administrators?" Or does the book handle all that?
    Goals for 2018:
    Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
    Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
    To-do | In Progress | Completed
  • Options
    ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    I have already done a basic course on Python and have following a Computer science for beginners course which focused heavily on Python :)
    UnixGuy thank you for the reply. I am currently unemployed I really want to get my foot in the door for a company that uses Linux. Question is how the hell do I go about it? I have been to a few interviews. I asked for feedback I came across really well but they gave the job to some Linux Guild of Wizards Scholar with 20 odd years Linux experience. You know what I mean one of those guys who lives, breathes Unix even has the beard so what chance do I have :) lol
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • Options
    ExpectExpect Member Posts: 252 ■■■■□□□□□□
    DoubleNNs wrote: »
    Expect - should you already know Python basics before reading "Python for System Administrators?" Or does the book handle all that?

    The book starts from the very basicsicon_thumright.gif
  • Options
    mjsinhsvmjsinhsv Member Posts: 167
    You might want to go after the Comptia linux+ or a redhat cert. to help get your foot in the door if you have your heart set on linux.
    Most unix admins dont start out in nix.
    They either start out doing windows sys admin stuff or they move over from dev-ops where they have already learned unix.
    It is way to easy to screw yourself using root if you don't know what you are doing.
  • Options
    UnixGuyUnixGuy Mod Posts: 4,565 Mod
    @Ally:

    best way that I know of is ==> Pass the RHCSA. you can take the easier route and do Linux+, but passing the RHCSA will put you in a much MUCH better position.

    Now, I wouldn't wait until you pass the RHCSA to get a job. I'd try to get an IT job (Any job, even if it's service desk or windows administration or anything really) and work hard to get the RHCSA. This way once you pass the RHCSA you will be applying to Linux jobs while being employed and having the RHCSA. I think this will improve your position :)
    Certs: GSTRT, GPEN, GCFA, CISM, CRISC, RHCE

    Learn GRC! GRC Mastery : https://grcmastery.com 

  • Options
    Node ManNode Man Member Posts: 668 ■■■□□□□□□□
    Bash +1

    I'm learning both at the same time. I'll write a script/program in Bash and then rewrite it in Python. Both have lots of free training pdfs online. I do all my Python writing in the VI editor so there is cross over skills there.
  • Options
    ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    That's the problem at the moment money, I would love to study for the RHCSA, Linux+ I am pretty comfortable with the material I was scoring very high marks on practice exams / tests in the Roderick Smith Books. Again the money situation is holding me back.

    It looks like I will have to find a I.T gig even if it's low paid and working with Windoze lol :)

    I have supported various versions of Windows in the past including server products but I just do not get the same satisfaction as I do when using Linux. There is no desire for me to learn technologies maybe I need to snap out of this mentality and embrace / use both. But I seem to have developed a obsession / passion for Linux and Open Source technologies is this normal? lol
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • Options
    UnixGuyUnixGuy Mod Posts: 4,565 Mod
    First things first :) Put all your energy now into finding a job, any job, where you can pay for your exams and have experience on your CV - much better than a gap in your CV.

    Then you can have time and money to pass the RHCSA.
    Certs: GSTRT, GPEN, GCFA, CISM, CRISC, RHCE

    Learn GRC! GRC Mastery : https://grcmastery.com 

Sign In or Register to comment.