Archive
Linux as an Automation Host

Automation is a perennial technical buzzword among System Administrators (SAs) and in management circles alike. Business owners and managers demand automation with the thought that it will save “man hours” and possibly decrease the need for a full technical staff. System Administrators realize that this is not the case nor is staff reduction the inevitable result of automation. The bad news is that the purpose of automation isn’t to reduce staff numbers. The good news is that there are several reasons for automation that make it a worthwhile pursuit.
• Reduce human error – Computers execute the same task repeatedly with no typos.
• Decrease repetitive tasks – Computers aren’t susceptible to boredom.
• Increase speed – Computers perform tasks very quickly—much faster than typing.
• Decrease low-level tasks – Free up System Administrator time for higher-level tasks.
• Present human-readable data – Automated tasks can output data into HTML.
Using Linux for an automation host makes sense for those who’ve embraced Linux for their businesses but it also makes sense for those who’ve traditionally relied on commercial UNIX. The skills your UNIX SAs spent years acquiring on those platforms translate quite well to Linux. Linux looks and reacts like commercial UNIX “flavors.” In fact, many of the same open source tools that Linux uses are available on it commercial counterparts.
The point is that using Linux for automation won’t require a huge financial outlay for training. Your UNIX SAs have the skills they need to make it work.
Distribution Selection
There’s no single correct answer to the, “Which distribution should I use?” question for every company. The correct answer is to use the distribution that you’re comfortable with or that you currently use. For example, if your company uses Red Hat Enterprise Linux (RHEL) for other tasks, then RHEL or one of its free derivatives (Fedora, CentOS, Scientific Linux) is an appropriate choice.
If you haven’t yet selected a distribution, you should start with one of the so-called “top-level” or parent distributions such as Debian, SUSE, Red Hat, Gentoo or Slackware. Ubuntu Linux, based on Debian, is also very popular, easy to use and well supported.
Components/Tools
If you’re going for the minimalist approach to automation, then you have everything you need with a basic Linux installation: The shell. The shell, commonly the Bourne-Again Shell (BASH or bash), contains all of the necessary components that you need to successfully automate just about any procedure performed manually at the command line. But, often minimal isn’t optimal and plenty of tools exist that are both powerful and easy to use. For example, if an SA wanted to expand a bit on the lowly shell for automation, Expect is an excellent choice for that first expansion.
Expect is an automation tool and it’s one of the tools considered as “essential” among thousands of SAs. From the official Expect site at http://expect.sourceforge.net, their apt description:
“Expect is a tool for automating interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this stuff trivial. Expect is also useful for testing these same applications. And by adding Tk, you can also wrap interactive applications in X11 GUIs. Expect can make easy all sorts of tasks that are prohibitively difficult with anything else. You will find that Expect is an absolutely invaluable tool – using it, you will be able to automate tasks that you’ve never even thought of before – and you’ll be able to do this automation quickly and easily.”
Expect is a scripting language that allows you to automate keystrokes including anticipating prompts, entering passwords and automating “interactive” sessions in the shell. In addition to Expect, I suggest that anyone who doesn’t enjoy the tedium of watching and entering username, password and other shell prompts also install Autoexpect.
Autoexpect “watches” your interactive shell session as you login, respond to various system prompts and logout. You have to clean up your automated Autoexpect scripts but it beats the alternative of manual entry.
For the non-minimalist SAs, several other valuable automation tools to add to your toolbox include the following. The lists show equivalent options under each category but isn’t meant to imply that you need ALL of the listed items in each category.
Scripting Languages
• PHP
• Ruby
• Python
• PERL
Web Services
• Apache
• NGINX
• Lighthttpd
• Thttpd
Database (RDBMS)
• MySQL
• PostgreSQL
• SQLite
• NoSQL
PERL is a common scripting language that is part of the base installation on most Linux distributions. It’s a powerful, mature and well-supported language. The selection of tools, however, is often a matter of personal preference and not a matter of superiority of one technology over another.
Whatever choices you make for your automation host tools, remember to document and comment your scripts so that when you return to debug or upgrade them, you’ll understand their functions and purposes.
User Interface
How you display your data gathered by your scripts is another concern for SAs. Some scripts run and do their jobs without the need for output to the screen, to a logfile or to a text file of any kind. However, if your automation includes gathering performance data, executing commands that produce interesting or valuable output or information that requires review, then you need to think seriously about how you’ll display that data.
Plain text files can be ugly to look at, logfiles can be tedious to pore through and screen-captured text can be impossible to realign into a meaningful document. The great equalizer is HTML. Viewing output in the comfort of a web browser has its advantages. Formatting, searchability and customizability are a few HTML advantages that come to mind.
Screen output can be bound by the HTML tags to preserve formatting so that the SA can read information exactly as the system designers originally intended it. You can also present data in tables, in CSV files or in specific file formats for use with proprietary applications. A very good method for gathering and presenting data is to load the data into a database for extraction by a scripting language and presented via HTML.
But, the user interface required for your data depends on your audience. System Administrators have different preferences and requirements than those who’d like to view data in a more formal way.
Automation Strategies
Strategies can run the gamut from automating a few tedious processes to a full-blown, 90%+ automated system. But, there’s one catch: You still have to have someone that knows what to do when things go wrong. A few years ago, when the big automation push first reared its head, SAs worried that they would eventually automate themselves out of a job. Automation hasn’t taken away but a few of the lowest level job duties. Notice the term, “job duties” not jobs.
Automation can offer cost savings to a company in that it saves labor on lower-level tasks. Senior-level SAs shouldn’t have to locate files that haven’t been touched in six months and flag them for long-term storage. An automated process should take care of that and the results reported to a text file, database or web page for casual review.
The automated gathering of performance data can save companies money by flagging systems that are overloaded or those that are underutilized. Automated processes can track file and filesystem changes to provide a pre-emptive notification of a system breach. Tracking user activity to measure productivity is an excellent feedback method during your annual personnel evaluation time.
All of these strategies save money. They save money because they save time and time is money. Using Linux is a part of the overall money-saving strategy. Automating processes with Linux is a step in the right direction for leveraging automation for your business.
You have to decide how much automation is correct for your business or business unit. The rule of thumb is that if a human regularly repeats a particular task, then that task should fall under serious scrutiny for automation. Tasks that require decisions, very complex tasks or tasks that require random timing to perform should remain manual.
Summary
Automation can offer significant cost-savings and advantages over “old school” manual processes. The range of possibilities for automated processes is wide. From simple archive scripts to very elaborate content management systems to fully automated performance data gathering and reporting scenarios. It’s wise to assess each process individually and strategically instead of announcing a blanket mandate to “automate everything” in the data center. Automation has its drawbacks. As long as everything works as designed, automation is an excellent way to streamline processes. However, when something goes wrong, you’ll need the human element to intercede and you can’t automate that.
Linux systems offer businesses a cost-effective and perfectly-suited-to-automation set of tools to suit almost any need. And, generally speaking, the automation tools listed in this article are cross-platform, which means that they work on a variety of operating systems. This cross-platform feature also means that scripts created on one system are portable to others.

This post was written as part of the IBM for Midsize Business program, which provides midsize businesses with the tools, expertise and solutions they need to become engines of a smarter planet.
Linux has a Place in the Enterprise

From its meager beginnings as a hobby project to its extreme success among geeks, Linux has survived lawsuits, boycotts and onslaughts from every corner of the UNIX, Windows and Mac computing markets. Linux has, in spite of its critics, made its way into the world’s data centers. Linux enjoyed early success as a host platform for the Apache web server but now has blossomed into a formidable contender for rack space. For an operating system, Linux has the best mixture of vendor neutrality, open source code base, stability, reliability, scalability and affordability. It also provides the user or administrator the choice of graphical user interfaces or none at all.
Linux has one very significant advantage over all other operating systems: Hardware compatibility. It runs on a variety of hardware platforms from wristwatches to mainframes, although it’s most familiar playing field is on x86 metal.
Two decades of community development and support have brought Linux into the mainstream as an enterprise-level operating system that’s competitive on every level of computing. Linux hosts workloads of all sizes and types: Web services, databases, applications, network services, file services, virtualization and cloud computing.
With the notable exceptions of Microsoft’s Hyper-V and Solaris Zones, Linux-based virtualization solutions are the standard in contemporary data centers. And, the world’s largest cloud computing vendor, Amazon, uses Xen virtualization for its services. Though it’s rare outside of Internet Service Provider (ISP) realms, you can run “Zones” virtualization on Linux too. Zones, containers or jails are a popular method of securely compartmentalizing Linux applications from one another. ISPs use containers to separate users from one another on shared systems for shell access. It’s an effective and secure method of leveraging inexpensive hardware over dozens of users.
Though Linux has a dedicated following, corporate buy-in and support from the world’s largest hardware and software vendors, there are still those who aren’t convinced. As late as mid-2011, I found several articles and commentary challenging the viability of Linux as a data center operating system.
The problem with Linux adoption stems from a misunderstanding of the Linux support model. Linux, as a kernel, and generally as an operating system, is free. Free means its code is free to use, change and adapt to any purpose. Some refer to this freedom as open source. Open source does not necessarily mean free. Proprietary software can be open source but it isn’t free to change, rebrand, etc. Linux is free software and it’s also open source.
It also means that Linux is free of charge. Vendors charge for media, consulting, support and a host of associated services but they usually do not charge for the Linux software itself.
The very thing that makes Linux so desirable to geeks and those knowledgeable in the ways of free software is also the aspect that makes some company executives turn away from Linux as a data center operating system. Incorrectly, they assume that since something is free and doesn’t have strings attached that there must be something wrong with it.
Dispelling myths associated with Linux use requires a lot of energy and time. But, there is one sure test for Linux data center viability: IT Services Support.
Linux has support, financial and technical, from the biggest names in the IT industry. Each of these industry giants has its own Linux distribution preference but, whichever distribution you decide to use, you can purchase full support for it. You can purchase 24x7x365 support from a variety of sources, including directly from Linux distribution vendors.
Every major IT services company supports Linux, Windows and commercial UNIX flavors as part of its portfolio. Linux is a mainstream operating system that carries workloads for every sized company in the world. Linux is no longer cute or niche. If you use any online web hosting services, web-based CRM software, databases, virtualization or cloud services, chances are greater than 90% that you’re using Linux behind the scenes for those services.
Linux supports high availability, clustering, high-performance computing and a variety of hardware platforms. It also supports industry standard LDAP (Directory) services, large databases, journaling filesystems, SMP computing and major computer languages including an implementation of Microsoft’s .NET platform.
Linux has its place in your data center doing the enterprise-level heavy lifting at a lower cost than comparable proprietary systems. The days of the monolithic, single operating system data centers are long gone. Heterogeneous networks, including Linux, are today’s standard fare.

This post was written as part of the IBM for Midsize Business program, which provides midsize businesses with the tools, expertise and solutions they need to become engines of a smarter planet.

You must be logged in to post a comment.