Programming Language for Systems Administrator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kanthi Kiran Narisetti

    #1

    Programming Language for Systems Administrator

    Hi All,

    I am Windows Systems Administrator(p lanning to migrate to Linux
    administration in near future), I have occassionally written few batch
    files and Vbscripts to automate my tasks.

    Now I have strong interest to learn a programming language that would
    help me to write Scripts or Application ( In Systems Administrative
    point of view) .

    I have read on net that Python is the best way to start of for beginers
    , Please let me your suggestions and help me out to chose to the right
    programming language to write scripts ranging from simple automation
    scripts to appliations for my workflow.

    I am confused to chose between C++,Python,Perl .

    Thanks in Advance

    Kk

  • Grig Gheorghiu

    #2
    Re: Programming Language for Systems Administrator

    In my experience, Python is more Windows-friendly than Perl. Mark
    Hammond's Python Extensions for Windows are a lifesaver. You can
    download the package from http://sourceforge.net/projects/pywin32/ or
    install the ActiveState Python package, which includes the Windows
    extensions.

    I use Python for example to automate user and mailbox management in
    Active Directory and Exchange. I also use the mxODBC module to interact
    with SQL Server.

    I warmly recommend "Python Programming on Win32" by Mark Hammond and
    Andy Robinson (O'Reilly).

    Grig

    Comment

    • johnny.shz@gmail.com

      #3
      Re: Programming Language for Systems Administrator


      Kanthi Kiran Narisetti wrote:[color=blue]
      > Hi All,
      >
      > I am Windows Systems Administrator(p lanning to migrate to Linux
      > administration in near future), I have occassionally written few[/color]
      batch[color=blue]
      > files and Vbscripts to automate my tasks.
      >
      > Now I have strong interest to learn a programming language that would
      > help me to write Scripts or Application ( In Systems Administrative
      > point of view) .
      >
      > I have read on net that Python is the best way to start of for[/color]
      beginers[color=blue]
      > , Please let me your suggestions and help me out to chose to the[/color]
      right[color=blue]
      > programming language to write scripts ranging from simple automation
      > scripts to appliations for my workflow.
      >
      > I am confused to chose between C++,Python,Perl .
      >
      > Thanks in Advance
      >
      > Kk[/color]

      Comment

      • Sizer

        #4
        Re: Programming Language for Systems Administrator

        "Kanthi Kiran Narisetti" <TechAlerts@gma il.com> wrote in
        news:1113253691 .821235.9750@o1 3g2000cwo.googl egroups.com:
        [color=blue]
        > I am Windows Systems Administrator(p lanning to migrate to Linux
        > administration in near future), I have occassionally written few batch
        > files and Vbscripts to automate my tasks.
        >
        > Now I have strong interest to learn a programming language that would
        > help me to write Scripts or Application ( In Systems Administrative
        > point of view) .
        > [...]
        > I am confused to chose between C++,Python,Perl .[/color]

        I admin both Windows and Linux (Slackware, Debian) boxes, and I think
        your best choice is either Python or learning bash scripting. C++ is just
        no good - I use it for some large applications, but for sysadmin and
        utility stuff it just takes 10 times as much work to get anything done as
        Python does.

        bash scripting is still the way most people seem to do these things on
        linux (it's equivalent to batch files under Windows/DOS but far more
        powerful), which is the reason I suggest you take a look at it - it's
        still useful for writing small things that you want to send to other
        people where you don't know if they have python installed. Of course this
        is made less useful for you because you need to install a bash
        interpreter on Windows so it's no longer cross platform.

        I suggest you learn Python instead of Perl. Perl and Python are close
        enough in terms of functionality (with a little give and take, please no
        holy wars), so I wouldn't say one is Better than the other if you already
        know it. But for someone starting from scratch I think you will find that
        while the perl program may be smaller the python program will be far more
        readable, maintainable, and easier to write.

        I use bash scripting for small stuff (just simple command lines in
        sequence), C++ and Java for a few things that require it (though I really
        hate them both after using Python) and Python whenever I can. Python on
        Linux/Windows is amazingly cross platform as long as you use functions
        like os.path.join('d ir','file') instead of hardcoding 'dir\\file' into
        your code. And use the glob, shutil, and os libraries to do all your
        hard work for you.

        Comment

        • rbt

          #5
          Re: Programming Language for Systems Administrator

          Kanthi Kiran Narisetti wrote:[color=blue]
          > Hi All,
          >
          > I am Windows Systems Administrator(p lanning to migrate to Linux
          > administration in near future), I have occassionally written few batch
          > files and Vbscripts to automate my tasks.
          >
          > Now I have strong interest to learn a programming language that would
          > help me to write Scripts or Application ( In Systems Administrative
          > point of view) .
          >
          > I have read on net that Python is the best way to start of for beginers
          > , Please let me your suggestions and help me out to chose to the right
          > programming language to write scripts ranging from simple automation
          > scripts to appliations for my workflow.
          >
          > I am confused to chose between C++,Python,Perl .
          >
          > Thanks in Advance
          >
          > Kk
          >[/color]

          I use Python for all sorts of Windows administration tasks. I can honestly say that
          I've yet to find a better Windows scripting language. I've used it to migrate Mac
          users to PCs (file conversions), laptop location reporting (ipconfig, route, etc.)...
          to help recover stolen laptops, and most recently a social security number search
          utility to identify files that should be safe guarded from identity theft hacks. See
          the latter here:



          In short, Python is the ideal language for scripting/programming on Windows computers.

          Best of luck,

          rbt

          Comment

          • Sizer

            #6
            Re: Programming Language for Systems Administrator

            Looking at my followup, I really didn't make it clear that you'll have to
            learn some bash scripting to be an effective *nix administrator, just
            because so many parts of the system use bash scripting. But python is much
            nicer to write anything non-trivial in.

            Comment

            • Ville Vainio

              #7
              Re: Programming Language for Systems Administrator

              >>>>> "Sizer" == Sizer <sizer@nospam.c om> writes:

              Sizer> Looking at my followup, I really didn't make it clear that
              Sizer> you'll have to learn some bash scripting to be an effective
              Sizer> *nix administrator, just because so many parts of the
              Sizer> system use bash scripting. But python is much nicer to
              Sizer> write anything non-trivial in.

              If you don't need to edit already existing system scripts, you don't
              really need to know bash scripting. For debugging purposes, it's easy
              to see what commands the script executes to perform a task.

              You just need to know about `backticks` and $ENV_VARS, but that's more
              general Unix knowledge than actual shell scripting.

              So IMHO learning bash scripting might be a waste of time, and it
              should be learnt 'as you go' - i.e. if/when you eventually bump into a
              problem where you need to be able to do bash scripting. There's the
              'Unix romantic' movement that still thinks shell scripts are a good
              idea, but this is my .02EUR to point out that not everyone agrees with
              them.

              --
              Ville Vainio http://tinyurl.com/2prnb

              Comment

              • Peter Maas

                #8
                Re: Programming Language for Systems Administrator

                Ville Vainio schrieb:[color=blue]
                > If you don't need to edit already existing system scripts, you don't
                > really need to know bash scripting. For debugging purposes, it's easy
                > to see what commands the script executes to perform a task.[/color]

                This is only true for trivial bash scripts. I have seen bash scripts
                which were quite hard to read especially for beginners.

                --
                -------------------------------------------------------------------
                Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
                E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
                -------------------------------------------------------------------

                Comment

                • Pierre-Frédéric Caillaud

                  #9
                  Re: Programming Language for Systems Administrator

                  > I am confused to chose between C++,Python,Perl .

                  Writing scripts in C++, you'll just die of brain burn.

                  Python has very good shell integration and I heard it can do funky stuff
                  with COM/OLE with a few lines of code where you'd need a few pages worth
                  of impossible to understand COM code to do the same in C. Also basic shell
                  tasks like spawning processes, piping from / to their output, regular
                  expressions, parsing files, etc are a breeze. There are modules for INI
                  files, csv files, etc.

                  Perl should be about the same, but you have to like the scary syntax.

                  Comment

                  • beliavsky@aol.com

                    #10
                    Re: Programming Language for Systems Administrator

                    Ville Vainio wrote:
                    [color=blue]
                    > If you don't need to edit already existing system scripts, you don't
                    > really need to know bash scripting. For debugging purposes, it's easy
                    > to see what commands the script executes to perform a task.
                    >
                    > You just need to know about `backticks` and $ENV_VARS, but that's[/color]
                    more[color=blue]
                    > general Unix knowledge than actual shell scripting.
                    >
                    > So IMHO learning bash scripting might be a waste of time, and it
                    > should be learnt 'as you go' - i.e. if/when you eventually bump into[/color]
                    a[color=blue]
                    > problem where you need to be able to do bash scripting. There's the
                    > 'Unix romantic' movement that still thinks shell scripts are a good
                    > idea, but this is my .02EUR to point out that not everyone agrees[/color]
                    with[color=blue]
                    > them.[/color]

                    The simplest script is just a set of commands one could run from the
                    command line. One step above is learning how to pass arguments (for
                    cmd.exe in Windows, they are just %1, %2, etc.) and set variables. I
                    think every computer user, not just system administrators, show know
                    this much about the shell language of his OS, regardless of whether
                    it's Windows, Unix, or something else. On Windows I often see people
                    "mousing around" instead of getting things done faster from the command
                    line.

                    I actually like the Windows cmd language (it's an acquired taste), but
                    I have read it is going away in Windows Longhorn (WH). That's an
                    argument for writing more complicated scripts in Python. WH is supposed
                    to get a much better shell, called Monad, inspired by the philosophy of
                    Gottfried Wilhelm Leibniz :).

                    Between a low-level shell scripting language and a higher-level
                    language like Python, and intermediate level language such as Rexx
                    could be considered. Many IBM people swear by it.

                    Comment

                    • Kanthi Kiran Narisetti

                      #11
                      Re: Programming Language for Systems Administrator

                      Hi All,

                      Thank You for your suggestions.... I request you all to eloborate the
                      Uses(In Practical) for systems administrator.S ome of my questions
                      regarding the same follows.

                      1)Can i build web applications in Python ? If so how. I am planning to
                      build a web application for intranet use which deals with workflow of
                      Internal office communication.

                      2)Which is best opensource database to be used with Python ?

                      3)When i write a remote execution script in python is it required that
                      python should be installed in remote system.

                      4)I heard about Perl/CGI and that CGI application done by python
                      too.....Is CGI still valid when PHP has taken over the WebApplication
                      Development, Dominating.

                      Sorry if these questions are out of this group , but answers to these ?
                      will help me a lot.

                      Thanks in Advance

                      Kanthi.

                      Comment

                      • Gerald Klix

                        #12
                        Re: Programming Language for Systems Administrator



                        Kanthi Kiran Narisetti schrieb:[color=blue]
                        > Hi All,
                        >
                        > Thank You for your suggestions.... I request you all to eloborate the
                        > Uses(In Practical) for systems administrator.S ome of my questions
                        > regarding the same follows.
                        >
                        > 1)Can i build web applications in Python ? If so how. I am planning to
                        > build a web application for intranet use which deals with workflow of
                        > Internal office communication.[/color]
                        Yes, you can.
                        There are far too many options, to be listed here:
                        Here are just 3 pointers:




                        [color=blue]
                        >
                        > 2)Which is best opensource database to be used with Python ?[/color]
                        It's hard to say. It depends on our taste and the type of your application.
                        There is a python standard for a relation DB-API
                        and there are som object relational adapters, like:





                        And, of course, there is ZODB the object oriented DB below Zope:


                        [color=blue]
                        >
                        > 3)When i write a remote execution script in python is it required that
                        > python should be installed in remote system.[/color]
                        No.
                        Using xmlrpc the server and may be written in any programming language.
                        xmlrpc is include din the standard libray.
                        Other remote execution systems use CORBA or do things upon their own:


                        It is also possible to package python applications in an executable using:


                        or the Freeze utility delivered with the python standard distribution.
                        [color=blue]
                        >
                        > 4)I heard about Perl/CGI and that CGI application done by python
                        > too.....Is CGI still valid when PHP has taken over the WebApplication
                        > Development, Dominating.[/color]
                        No it's rather slow, but widley used. There is a mod_python for Apache
                        which is used be some of the web application frameworks mentioned above.[color=blue]
                        >
                        > Sorry if these questions are out of this group , but answers to these ?
                        > will help me a lot.[/color]
                        The are perfectly valid.

                        HTH,
                        Gerald

                        --
                        GPG-Key: http://keyserver.veridis.com:11371/search?q=0xA140D634

                        Comment

                        • Laszlo Zsolt Nagy

                          #13
                          Re: Programming Language for Systems Administrator


                          Hello,

                          I have some answers but for some of your questions, there are many
                          (possibly good) answers.
                          [color=blue]
                          >1)Can i build web applications in Python ? If so how. I am planning to
                          >build a web application for intranet use which deals with workflow of
                          >Internal office communication.
                          >
                          >[/color]
                          I believe you want something that is more just a mailing list. There are
                          at least 4 different solutions for creating web sites with Python.
                          Here are some:

                          Plone (www.plone.org)
                          Zope (Plone is build with Zope)
                          mod_python

                          Depends on what you need and how much time you have to do it.
                          [color=blue]
                          >2)Which is best opensource database to be used with Python ?
                          >
                          >[/color]

                          Under Windows platform, I would like to recommend PostgreSQL 8 - fast
                          enough, it has many data types, procedural languages, triggers,
                          contributed extensions. Supports nested transactions, deferrable
                          constraints etc. For small applications, it can be too heavy.
                          For smaller, simple applications you can consider FireBird. It is more
                          simple and lightweight.
                          I also tried SAP-DB before. I cannot tell too much about SAP but it
                          looked promising.
                          I do not recommend MySQL. If you really want to take advantage of the
                          modern concepts of today's database systems, you will notice that MySQL
                          is not standard enough and usually you will find something that you
                          cannot do with it. (Otherwise MySQL is very popular.)

                          You can also try other "object persistence" systems. (For example, ZODB
                          ) They are not relational databases but they can be good for you.
                          [color=blue]
                          >3)When i write a remote execution script in python is it required that
                          >python should be installed in remote system.
                          >
                          >[/color]
                          I'm not sure what it means. Are you talking about RPC? You can write COM
                          servers using Python. Does this answer your question?
                          [color=blue]
                          >4)I heard about Perl/CGI and that CGI application done by python
                          >too.....Is CGI still valid when PHP has taken over the WebApplication
                          >Development, Dominating.
                          >
                          >[/color]
                          CGI is still valid but nobody will recommend it to you. It is obsolete.
                          You should better use a templating or content management system. For
                          bigger sites, you can use a better web application server like Zope,
                          make the programming part at lower level. It requires more knowledge but
                          gives you virtually infinite number of possiblilites.
                          [color=blue]
                          >Sorry if these questions are out of this group , but answers to these ?
                          >will help me a lot.
                          >
                          >[/color]
                          It seems to me that you have interests in various fields but it looks
                          you did not search on the internet.
                          For example, if you search for "web development Python wiki" on google
                          then you will get this link
                          on the first page:

                          python web applications frameworks webware cheetah skunkweb cherrypy quixote


                          I can't believe that you tried to get information from search engines.
                          Please do not ask this list to dig the information for you.
                          Search on the internet first. Use Python Wiki. Read the articles, read
                          at least the front pages of the tools found. Compare them yourself.
                          Then if you still need to choose between two but you cannot decide wich
                          one to use - you can come back and ask others what is their experience.

                          --
                          _______________ _______________ _______________ _______________ _____
                          Laszlo Nagy web: http://designasign.biz
                          IT Consultant mail: gandalf@geochem source.com

                          Python forever!


                          Comment

                          • Terry Reedy

                            #14
                            Re: Programming Language for Systems Administrator


                            "Kanthi Kiran Narisetti" <TechAlerts@gma il.com> wrote in message
                            news:1113311618 .838281.205380@ l41g2000cwc.goo glegroups.com.. .[color=blue]
                            >.Some of my questions
                            > regarding the same follows.[/color]

                            Most of these have been discussed many times. You can use Google to search
                            the archives of this newsgroup. I strongly recommend that you learn to use
                            that resource.
                            [color=blue]
                            > 1)Can i build web applications in Python ? If so how. I am planning to
                            > build a web application for intranet use which deals with workflow of
                            > Internal office communication.[/color]

                            Yes, see Google
                            [color=blue]
                            > 2)Which is best opensource database to be used with Python ?[/color]

                            Currently being debated in another thread. See Google for previous
                            discussions.
                            [color=blue]
                            > 3)When i write a remote execution script in python is it required that
                            > python should be installed in remote system.[/color]

                            Yes. I think there are a couple of options that have been discussed.

                            Terry J. Reedy



                            Comment

                            • Brian van den Broek

                              #15
                              [OT] Re: Programming Language for Systems Administrator

                              beliavsky@aol.c om said unto the world upon 2005-04-12 08:11:

                              <SNIP>
                              [color=blue]
                              > I actually like the Windows cmd language (it's an acquired taste), but
                              > I have read it is going away in Windows Longhorn (WH). That's an
                              > argument for writing more complicated scripts in Python. WH is supposed
                              > to get a much better shell, called Monad, inspired by the philosophy of
                              > Gottfried Wilhelm Leibniz :).[/color]

                              Hi all,

                              this is the first I've heard of Monad.

                              Leibniz characterized his monads as the fundamental building blocks of
                              nature, insusceptible of change from the outside, and as "windowless ".

                              So, if the account of MS's plans is true, it would seem to indicate a
                              combination of arrogance, honesty, and ignorance. (I leave it to you
                              to decide which part, if any, of this triad, is surprising.)

                              Best to all,

                              Brian vdB

                              Comment

                              Working...