You are not logged in.

#1 2012-05-12 12:44:50

Riptawr
Member
Registered: 2011-09-14
Posts: 18

Linux/Unix administrator's programming language of choice

Greetings,

I finally got everything running to the point where i have 1-2 hours free time during work big_smile
So i was wondering which programming language i should learn with focus on linux server administration. (read below)

Some background: Most of my tasks atm include standartization and developing typical solutions for common business processes. I worked with MS AD enough to understand that it sucks (yes, honestly.. a time deviation of 1hour from the domain server preventing 70% of equipment from functioning) so my aim is to find (or develop) alternatives. 
My "programming" background to this day involves only small tweaks with html and bash scripts (switching to reserve internet connection, basic server status scripts, backup, cleaning of old files etc.)
Hardware currently in use: Arch with drbd, kvm for virtualization and redundancy. CentOS - mailserver with Apache,postfix,mysql etc. FreeBSD as gateway cluster with BIND, NTP and stuff, also backup servers. And way too much microsoft running on the VMs.

Choosing a programming language i wanted to keep in mind following tasks:
1. Improving server monitoring script (which currently is really just a server pinging bash script that prints something on a webpage with apache)
- needs some way to check services beyond pinging the servers, f.e. telnet the mailserver on pop3, checking whether shared folders are mounted, printers are visible, checking the time on the AD server (hate this one big_smile)
- checking whether the backup is working (some way of analizing the logs and sending "ok" would be enough)

2. automatization of starting and stopping VM's in case of failure
- currently i have to assign primary and secondary drbd, change the autostart script on all nodes according to who is the new primary for the VM and then start the VM manually - which is annoying, especially if i forget to change even one line in one script and the whole MS servers start to hang because of an IP conflict.

3. Something to get rid of Acronis Enterprise Suite for backing up
- it hangs almost every time that someone forgot to close his damn xls file after work.

Therefore i worked out some guidelines for the language:
- crossplatform (MS, Linux and BSD servers in use)
- replacement for bash, should be as easy to implement on any linux and able to work with bash commands (or replace them without the need for much hassle)
- easy to implement with other languages and the web and maybe some common API (like the python script in O'reilly that steals the coffee bean prices from a webpage)
- able to create simple filters for analizing and reformatting huge chunks of texts

PS: i know there may be ready solutions, but i prefer to learn things by doing them myself


I'm looking forward to people sharing their experience in similar tasks,

Rip

Offline

#2 2012-05-12 16:12:50

Bellum
Member
Registered: 2011-08-24
Posts: 230

Re: Linux/Unix administrator's programming language of choice

Python? It's not a replacement for Bash, though. You say the language should be able to call bash commands, but it would be easier to have bash commands pipe your scripts together. Shell and more general purpose languages like Python are good at different things. But it fits your other requirements. 

You could install cygwin and use sh in Windows, though I'm not sure how useful that would be outside of a nix environment. The thing about shell is that it's an interface to the OS and necessarily platform specific.

Last edited by Bellum (2012-05-12 16:13:13)

Offline

#3 2012-05-12 17:24:46

stealthy
Member
Registered: 2011-05-02
Posts: 67

Re: Linux/Unix administrator's programming language of choice

I've actually had a hard time finding something that does exactly what I want (linux admin automation, and a "overview" of the general system status). Munin will give you graphs which is "ok", Nagios looks like its from the 90's and has better support for "paying customers", etc...

I'm wanting to build a standardized admining system, so I can actually have time to work on other things. I think it should be KISS, and modular (to keep it lightweight, and to do anything "extra" that someone might want). Webmin comes close, but I don't think it has a CLI. I've tried Puppet and I have problems maintaining Arch and Ubuntu (server), and I want something to fix that.

I've actually started this too, (in Python 2), https://github.com/Afterburn/hal. Its by far not complete, but I'm trying to adhear to what I've stated. Here is a pic http://imgur.com/MZls5. As of now it just logs stuff to a postgres db, and will email you if something is wrong (you have to tell it when it should email you, ie if free space in boot is less than %10).

Sorry if I've kinda skipped around (tired) but at the least I want a solid (lightweight) alerting system (mainly through email, but as I said I want it modular so people can receive updates via RSS if they choose). I'll sub to this thread and explain further when I get a chance.


clipodder-git A small simple cron-friendly podcast downloader, with support for arbitrary user defined media types (pdf, html, etc...)

Offline

#4 2012-05-12 19:20:10

Riptawr
Member
Registered: 2011-09-14
Posts: 18

Re: Linux/Unix administrator's programming language of choice

I read a bit about cygwin - i'll definitely give it a try over the next few days with current bash scripts.

@Bellum: for now python and perl definitely look like best candidates - as they seem to fit well into the sysadmin environment, maybe there are people in the arch com. who prefer one over the other and want to share why?

@stealthy: +1 on popular monitoring tools. My idea was not to make it modular, but to use a centralized server outside the client's network, which actually accumulates the data and can run some nasty statistics/analyzing without stealing client's resources (in other words - they just don't understand why they have to pay THAT much for a server that will do things they don't think are priority at all) - so i probably run this service as a bonus outside of contract for well behaving clients (i hope they are not reading this big_smile)
That would allow to take it one step further some day - a form of intelligent system that interprets all data and gives reports or does low-tier tasks without intervention. F.E. Checking the security cameras for blinking red lights on printers and leaving an inquiry for buying new ink at the necessary department ^~ -
in that context would be nice to hear from anybody who has AI programming experience and/or uses LISP or Sheme for practical tasks.

Offline

Board footer

Powered by FluxBB