Section 13.1. What to Automate?


13.1. What to Automate?

It's difficult to find time to automate processes, so we have to be choosy. We can't automate everything. The problems SAs typically deal with fall into four general categories :

  • Simple things done once. Category 1 includes most of your daily work. If it is simple and you do it only once, there is no sense in automating it. It would take longer to automate than to do the task.

  • Hard things done once. Category 2 contains the tasks that are a bit difficult to get right the first time, and by recording the final (working) command into a script, you get a free record of how to do the task next time. If you need to do it once, you'll need to do it again eventually. Things in this category also include multicommand sequences that are best tested one command at a time, building up until you have the entire sequence working. Then you can use the sequence with confidence that it will work.

  • Simple things done often. Category 3 is the obvious case where automation will pay off with the most impact. The time you invest in automating the procedure will be paid off soon, since the task is one that you perform a lot. Always automate the boring, repetitive stuff.

  • Hard things done often. Category 4 is where a lot of SAs get stuck because they have bitten off more than they can chew. This is the category where one should look into convincing management to allocate greater resources (time and money) into solving this problem. The result may be the purchase of a commercial product, integration of free and/or open source tools to accomplish the task, or development of an in-house solution.

Now, for the visual thinkers, it may help to see these categories as a chart (Figure 13-1).

Figure 13-1. Categories of SA tasks


People are often surprised to see that I automate simple things done often. If they are simple, why automate at all? I automate a wide variety of processes within Categories 2 and 3, from the biggest tasks to the smallest command lines, for the same reason. Automating tasks gets me repeatability, scalability, and typo-free execution:

  • Repeatability means I can do something consistently many times. For example, when configuring new machines, I want them all to start out with the same software configuration and preferences. Otherwise, supporting them is going to be a nightmare. If I automate the installation process, then it becomes repeatable, and each machine starts out the same. If I figured out something that works, I want to do it exactly that way every time.

  • Automation can replace the need to memorize something complicated that is done rarely. Sometimes it just plain takes a long time to figure out the right set of command-line options to get something to work. I turn the single command into a script so that months from now I won't have to reinvent the wheel. That's long-term repeatability. For example, on Mac OS X, I can burn an ISO image onto a CD-ROM with the hdutil command. However, rather than reading the manual page each time to help me remember all the different options I like to use, I've encapsulated that one-line command into a script. Even if I don't use that script, I can refer to it to see what combination of options has worked for me.

  • Scalability. This means that I can do the process no matter how large my network grows. Once I automate a process, I can run the script on all my machines, scaling my knowledge to affect all the hosts on my network. For example, modifying a particular SSH server setting is quite easy for one machine. A few seconds with a text editor, and sshd_config is changed. However, if I automate the process, I can then use that procedure on hundreds of machines, possibly letting it run overnight. I don't have to be there for each one. I don't have to care if there are 10 or 10,000 machines being updated.

  • Automation can help replace error-prone procedures. There are plenty of short procedures that are just plain difficult to type correctly every time. There is a short sequence of commands that I type a lot. In those few lines, I had to repeat a user's login ID (her name) three times and her Unix UID (the number) twice. It's simple to type but easy to make a typo. By turning this task into a script, I prevent the possibility of making a typo. Even though the sequence is only a few lines, it's worth having as a script.




Time Management for System Administrators
Time Management for System Administrators
ISBN: 0596007833
EAN: 2147483647
Year: 2003
Pages: 117

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net