Programming Language for Systems Administrator

Discussion in 'Python' started by Kanthi Kiran Narisetti, Apr 11, 2005.

  1. Hi All,

    I am Windows Systems Administrator(planning 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
    Kanthi Kiran Narisetti, Apr 11, 2005
    #1
    1. Advertising

  2. 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
    Grig Gheorghiu, Apr 11, 2005
    #2
    1. Advertising

  3. Kanthi Kiran Narisetti

    Guest

    Kanthi Kiran Narisetti wrote:
    > Hi All,
    >
    > I am Windows Systems Administrator(planning 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
    , Apr 11, 2005
    #3
  4. Kanthi Kiran Narisetti

    Sizer Guest

    "Kanthi Kiran Narisetti" <> wrote in
    news::

    > I am Windows Systems Administrator(planning 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.


    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('dir','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.
    Sizer, Apr 12, 2005
    #4
  5. Kanthi Kiran Narisetti

    rbt Guest

    Kanthi Kiran Narisetti wrote:
    > Hi All,
    >
    > I am Windows Systems Administrator(planning 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
    >


    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:

    http://filebox.vt.edu/users/rtilley/public/find_ssns/find_ssns.html

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

    Best of luck,

    rbt
    rbt, Apr 12, 2005
    #5
  6. Kanthi Kiran Narisetti

    Sizer Guest

    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.
    Sizer, Apr 12, 2005
    #6
  7. Kanthi Kiran Narisetti

    Ville Vainio Guest

    >>>>> "Sizer" == Sizer <> 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
    Ville Vainio, Apr 12, 2005
    #7
  8. Kanthi Kiran Narisetti

    Peter Maas Guest

    Ville Vainio schrieb:
    > 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.


    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 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
    -------------------------------------------------------------------
    Peter Maas, Apr 12, 2005
    #8
  9. > 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.
    =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=, Apr 12, 2005
    #9
  10. Kanthi Kiran Narisetti

    Guest

    Ville Vainio wrote:

    > 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.


    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.
    , Apr 12, 2005
    #10
  11. Hi All,

    Thank You for your suggestions....I request you all to eloborate the
    Uses(In Practical) for systems administrator.Some 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.
    Kanthi Kiran Narisetti, Apr 12, 2005
    #11
  12. Kanthi Kiran Narisetti

    Gerald Klix Guest

    Kanthi Kiran Narisetti schrieb:
    > Hi All,
    >
    > Thank You for your suggestions....I request you all to eloborate the
    > Uses(In Practical) for systems administrator.Some 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.

    Yes, you can.
    There are far too many options, to be listed here:
    Here are just 3 pointers:
    http://www.zope.org/
    http://www.cherrypy.org/
    http://www.webwareforpython.org/
    http://skunkweb.sourceforge.net/

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

    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:
    http://python-dbo.sourceforge.net/
    http://sqlobject.org/
    http://skunkweb.sourceforge.net/PyDO/
    http://dustman.net/andy/python/SQLDict

    And, of course, there is ZODB the object oriented DB below Zope:
    http://www.zope.org/Products/ZODB3.3


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

    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:
    http://pyro.sourceforge.net/

    It is also possible to package python applications in an executable using:
    http://starship.python.net/crew/theller/py2exe/
    http://starship.python.net/crew/atuining/cx_Freeze/
    or the Freeze utility delivered with the python standard distribution.

    >
    > 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.

    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.
    >
    > Sorry if these questions are out of this group , but answers to these ?
    > will help me a lot.

    The are perfectly valid.

    HTH,
    Gerald

    --
    GPG-Key: http://keyserver.veridis.com:11371/search?q=0xA140D634
    Gerald Klix, Apr 12, 2005
    #12
  13. Hello,

    I have some answers but for some of your questions, there are many
    (possibly good) answers.

    >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.
    >
    >

    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.

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


    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.

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

    I'm not sure what it means. Are you talking about RPC? You can write COM
    servers using Python. Does this answer your question?

    >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.
    >
    >

    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.

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

    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:

    http://www.fredshack.com/docs/pythonweb.html

    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:

    Python forever!
    Laszlo Zsolt Nagy, Apr 12, 2005
    #13
  14. Kanthi Kiran Narisetti

    Terry Reedy Guest

    "Kanthi Kiran Narisetti" <> wrote in message
    news:...
    >.Some of my questions
    > regarding the same follows.


    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.

    > 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.


    Yes, see Google

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


    Currently being debated in another thread. See Google for previous
    discussions.

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


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

    Terry J. Reedy
    Terry Reedy, Apr 12, 2005
    #14
  15. [OT] Re: Programming Language for Systems Administrator

    said unto the world upon 2005-04-12 08:11:

    <SNIP>

    > 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 :).


    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
    Brian van den Broek, Apr 12, 2005
    #15
  16. On Tue, 12 Apr 2005 15:41:46 +0200, Laszlo Zsolt Nagy
    <> declaimed the following in comp.lang.python:

    > For smaller, simple applications you can consider FireBird. It is more
    > simple and lightweight.


    Derived from the Interbase system...

    > I also tried SAP-DB before. I cannot tell too much about SAP but it
    > looked promising.


    Now known as (or was, last time I checked) "MaxDB by MySQL"

    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Home Page: <http://www.dm.net/~wulfraed/> <
    > Overflow Page: <http://wlfraed.home.netcom.com/> <
    Dennis Lee Bieber, Apr 12, 2005
    #16
  17. Kanthi Kiran Narisetti

    Buck Nuggets Guest

    >> I also tried SAP-DB before.

    > Now known as (or was, last time I checked) "MaxDB by MySQL"


    and formerly known as the pre-relational dbms 'Adabas'. I think the
    only reason for its continued existance is that SAP was hoping for a
    very low cost, low-end database years ago. However, the database world
    has changed substantially over the last ten years: you can get
    postgresql and firebird for nothing, and db2 & oracle are often under
    $1000 for a small server.

    With that in mind I can't think of a database that's more of a has-been
    than maxdb. Maybe something from the 70s like IMS-DB or Model 204?

    buck
    Buck Nuggets, Apr 12, 2005
    #17

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


    What do you want to do ?

    > 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.


    Sure, you could use mod_python+apache2 or Zope, Skunkweb... there's a lot
    of options depending on what you need. I find it better than PHP because
    it'll raise exceptions when you do something funky. PHP's way of ignoring
    missing keys in arrays or silent type conversions is a double ended sword
    and can simplify code as well as giving hard to trace bugs.

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


    I like postgresql a lot, and the psycopg adapter for python is great.

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


    Yes.

    > 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.


    CGI will be slow as it spawns an interpreter for each request. See
    mod_python.
    =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=, Apr 12, 2005
    #18
  19. Kanthi Kiran Narisetti

    Guest

    Brian van den Broek wrote:
    > said unto the world upon 2005-04-12 08:11:
    >
    > <SNIP>
    >
    > > 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 :).

    >
    > 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


    I was joking about Leibniz, but from the Wikipedia article
    http://en.wikipedia.org/wiki/MSH_(shell) it appears that the codename
    of the new Microsft shell was in small part inspired by the philosophy
    of Leibniz:

    "Central concepts
    The system's codename comes from Gottfried Leibniz's "Monadology", a
    philosophy which says that everything is a composition of fundamental
    elements called 'Monads', which are all integrated together in
    'pre-established harmony'. Similarly, the focus of MSH is on
    composition of complex tasks from a series of components. In this case,
    the components are special programs called commandlets (or cmdlets),
    which are .NET classes designed to use the features of the environment.
    The key difference between the Unix approach and the MSH one is that
    rather than creating a "pipeline" based on textual input and output,
    MSH passes data between the various commandlets as arbitrary objects.

    If accessed individually from the command-line, a commandlet's output
    will automatically be converted into text, but if its output is to be
    used by another commandlet, it will be converted into whatever form of
    object is most appropriate for that commandlet's input. This has the
    advantage of eliminating the need for the many text-processing
    utilities which are common in Unix pipelines, such as grep and awk, as
    well as allowing things to be combined interactively, or in a scripting
    environment, which would otherwise require a more complex programming
    language. For instance, a listing of processes will consist not of text
    describing them, but objects representing them, so that methods can be
    called on those objects without explicit reference to any outside
    structure or library.

    MSH is part of an overall strategy within Longhorn to treat all parts
    of the OS as .NET objects, and thus allow the user greater flexibility
    over how they are used. This is aimed to make previously complex
    interactions manageable within the bounds of frameworks such as MSH;
    for example, Longhorn's registry can be exported as though it were a
    filesystem, and navigated by treating it as a hierarchy of files and
    directories."
    , Apr 12, 2005
    #19
  20. Kanthi Kiran Narisetti

    Ville Vainio Guest

    >>>>> "beliavsky" == beliavsky <> writes:

    beliavsky> The key difference between the Unix approach and the
    beliavsky> MSH one is that rather than creating a "pipeline" based
    beliavsky> on textual input and output, MSH passes data between
    beliavsky> the various commandlets as arbitrary objects.

    They clearly read my rant from last summer

    http://groups.google.com/groups?threadm=

    ;-)

    --
    Ville Vainio http://tinyurl.com/2prnb
    Ville Vainio, Apr 13, 2005
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    2
    Views:
    611
  2. Kanthi Kiran Narisetti

    Programming Language for Systems Administrator

    Kanthi Kiran Narisetti, Apr 11, 2005, in forum: C++
    Replies:
    0
    Views:
    383
    Kanthi Kiran Narisetti
    Apr 11, 2005
  3. Kanthi Kiran Narisetti

    Programming Language for Systems Administrator

    Kanthi Kiran Narisetti, Apr 11, 2005, in forum: C++
    Replies:
    1
    Views:
    376
    Victor Bazarov
    Apr 12, 2005
  4. Radha
    Replies:
    0
    Views:
    345
    Radha
    Aug 4, 2006
  5. Isaac
    Replies:
    0
    Views:
    321
    Isaac
    Oct 20, 2010
Loading...

Share This Page