Version 29 of System administration

Updated 2009-02-07 09:14:58 by LV

Does Tcl matter to system administrators? Absolutely; in fact, CL argues [L1 ] that Tcl is the single most useful language for them to learn.

[... details ...]

[... Windows, too. and MacOS. And OpenVMS and OS/400! ...]

[ Don Libes' papers on sysad: http://expect.nist.gov/doc/autoexpect.pdf ; http://expect.nist.gov/doc/bgpasswd.ps ; http://expect.nist.gov/doc/sysadm.ps ; ... others ...]


Cameron Laird had this to say (regarding a Tcl vs Perl for Sys Admin question) in comp.lang.tcl:

When people set up these bake-offs, I usually turn away; it's just too easy for Perl to dominate in the obvious "check-box" items.

I have particularly strong feelings about this role, though. In all the "Is {Java,Erlang,PHP,...} better than {C++,Rexx,Ada,...} for {Web scripting,COM automation,...}?" competitions, one of the easiest correct conclusions to draw is that Tcl is the single most essential and desirable language for cross-platform system administration. Here's why:

  • Expect is a Tcl extension. Expect is absolutely crucial for SysAd. Perl has an Expect.pm--but it's about a decade (slight exaggeration) behind the original Expect in its polish.
  • Tk is a Tcl extension. Again, Perl has Perl/Tk, but the latter has serious flaws on the Windows side.
  • Tcl glues better than Perl. Specifically, it's a lot easier to teach newcomers how to manage external processes with Tcl than with Perl. Some Perlites will argue this point. I've been studying it for a long time. I'm right.
  • Tcl Blend works. The Java/Perl combinations mostly don't.
  • Tcl has the strongest tradition of use as a testing language. Is the pertinence of that to SysAd clear?
  • Naive users take to Tcl at least as quickly as to Perl.

I don't put too much weight on this proposition. Season to taste, or, more specifically, apply as appropriate in your own situation.

In what language did Oracle develop its Oracle Enterprise Manager sysad tool? Tcl. In what language did IBM develop its WebSphere Control Program? OK, Patrick, I know you already know this answer. Neither of these companies particularly *likes* Tcl; I've talked with PR types with both, and they're trained to hide Tcl's role. Tcl's technical virtues in these applications are unmistakeable, though.

LH What language is Vigentte StoryServer in? Or the BMC Patrol installation GUI? [CL responds: 'Same one as the Software AG installer.]


OK, it's true: there's a hole in the Tcl-SysAd story, and it has to do with logging--SysLog and such.

Tcllib seems like a natural place to build a plug for this hole.


Another issue for system administration - how to roll Tcl out to your site.

Some of the issues to consider:

  • Does your operating system already come with Tcl?
  • If so, then are you satisfied with waiting on updates from the vendor, or do you need to install newer (or older) versions to get around problems or add new features?
  • If you are going install your own version, how do you do so in a manner that prevents a) current vendor utilities from breaking as you update Tcl, b) damage to your tcl installation when the operating system is patched or updated
  • How many versions of Tcl (or extensions) will you keep online at one time?
  • How are you going to handle updating user applications that are dependant on specific version features (or mis-features)?
  • Where will extensions be installed?
  • Where will docs, demos, etc. be installed?

2006-12-29 jmpb - Thought it was worth mentioning: tclkits, starkits and starpacks ;). The OS need not come with Tcl. This is IMHO a valid answer to all of those questions (except maybe extensions, docs, demos, etc. - online or downloaded in a starkit).


Pages dealing with System Administration (for specific tasks):

A tiny URL extractor

What groups are shared by these users?

How can I calculate how much disk space is being used in a directory

snort


SMC starfish


SEH 20080314 -- Several new Tcl packages relevant to system administration have popped up on Sourceforge recently, all written by a single author, Alexandros Stergiakis:

  • tcl -mq - POSIX Message Queues for Tcl [L2 ] : This extension provides a Tcl interface to POSIX Message Queues. It allows scripts to create/open/close/unlink multiple parallel message queues, and to send/receive messages synchronously and asynchronously to/from them.
  • tcl -inotify - File -system notification service for Tcl [L3 ] : This is a Tcl extension that provides an interface to the inotify file system notification service of the Linux kernel.
  • tcl -pam - PAM Authentication for Tcl [L4 ] : This project provides a Tcl interface to Pluggable Authentication Modules as implemented in Linux. It implements a Tcl package that exports the client -side functionality of PAM to the Tcl programming language. This allows Tcl scripts to use PAM for authentication.
  • tcl -syslog - Syslog interface for Tcl [L5 ] : This project provides a Tcl interface to the standard *nix syslog service. It implements a Tcl package that exports the full functionality of the underlying syslog facility to the Tcl programming language. This includes local and remote logging.
  • tcl -snmptools - Tcl SNMP tools for managing remote agents [L6 ] : This is a Tcl package that provides SNMP tools for managing remote Agents. It uses the NetSNMP library and supports all standard SNMP v1/v2/v3 operations and more: get, set, getnext, walk, bulkget, bulkwalk, trap, translate and table.

All GPL.


outlog - Taking care of log rotations automagically

failsh

pass_gen


LV One thing that I'd love to find is some code to deal with monitoring log files. Log files come in many varieties, but in most cases, what one wants when monitoring would involve:

  • notification when something appeared in the log
  • optionally - statistics on how frequently certain key phrases have appeared in this log
  • able to dynamically handle when a log rotation occurs
  • able to alert in some manner when a serious entry appears
  • able to handle plain text logs or html formatted logs