What it takes (IMHO) to be a system admin

Maybe it is naive of me, but it seems that one noble aspiration for Linux users is to get a 'real job' as a system administrator (SA). The question has come up in some discussions recently 'What is involved in moving from Linux user to system administrator?'. Accordingly, here are some of my thoughts
.

DISCUSSION


  1. Change your mindset

  2. Learn new toolsets

  3. Learn to handle pressure

  4. Never start from scratch. Find something close and modify

  5. Hang out with experts

  6. Practice good debugging habits

  7. Learn manually, then codify

  8. Document what you do

  9. Learn to share

  10. Remember to have fun

Example scripts, killing things

Here are some examples of scripts that I have written. I offer them as a way to see inside one of the problems that an SA faces. The essential problem is how to allow inexperienced operators reset certain processes without giving them the root password. The obvious first step is to install sudo and add the kill command to the allowed commands. But this is too broad, and too narrow at the same time. Too broad in that they can kill things that they shouldn't (system processes, etc), too narrow in that they may need to kill hundreds of similar processes quickly. (All of these scripts are written in Perl 5.005 and will work on an HP-UX 10.20 system. I've made no effort to adapt them to Linux, because that is not the point. All of the kill scripts require root access or sudo.)

In following my own advice in #2 above, I was reteaching myself Perl while writing these scripts. They could also have been written using sh, or awk.


killp.pl script

To address the first problem, I wrote the following Perl script. It allows a person with sudo access to this script (not to kill in general) to kill processes belonging to a person. System processes are protected. killp.pl


killu.pl script

To address the second problem (killing batches of users) I created the killu.pl script. It takes a user prefix and kills all of the users whose login ids start with that prefix. It allows for some special ids to be protected so you don't kill supervisors, etc. Some of the protections can be overridden by specifying a longer prefix.


Examples, other things


du.pl script

On larger systems (AIX, HPUX, etc) you will encounter the idea of volume groups and logical volumes. This is a great idea which allows you to create virtual disks from collections of smaller or larger disks. Unfortunately, it spreads out the information so it is no longer easy to answer the question 'How much space is left?'. I wrote this du.pl script to combine the output of two commands (vgdisplay and bdf)


sortu script

Once you get over a screenful of users logged in, managing them, finding the idle ones, etc becomes a problem. This script sortu.pl combines the hectic output from who into a more readable format as well as allowing a summary to be generated.


Author

Jim Wildman has been mucking around Unix since 1985. After a few years on Suns, he changed jobs and started working on HP's. Then he added Linux in 1994 or 95, a dabbling of AIX in '98, and most recently some SGI IRIX. Those jobs included stints in electronics manufacturing, healthcare, and now the online sales industry. He is currently employed as a lead consultant by marchFIRST. Personal details might be found at The Wildman Family Home Page (depends if we've gotten around to it yet).


These pages were produced using some combination of RedHat Linux, Quanta, txt2html, and of course vim.
Questions and comments can be sent to Jim at jim@rossberry.com. All trademarks are the property of their respective holders. Last update Jan 23, 2001.