Systems Manageability Part 4: Systems Configuration - Port 25: The Open Source Community at Microsoft
< Back to Blogs
Systems Manageability Part 4: Systems Configuration by kishi on May 25, 2007 04:18PM

Background: This is Part 4, continuation of the series of 8 blogs I’m doing on Systems Manageability. In this specific blog, I will focus on and explain the second part of the “ontology” which is “Systems Configuration”

Level-Set: System Configuration and Management encompasses all tasks related to the configuration of a host in a standardized and (when possible) centralized way.  Many projects in this category provide a common configuration interface, either command-line or GUI-based, designed to ease typical administrative tasks.  Other projects, specifically Cfengine, provide a higher level policy-based system to provide consistent configuration and state management for a set of systems. Again, in this case there’s lots of different tools out there that can be used but we have focused on the most popular ones such as Webmin, YaST, SSH, VNC and Cfengine. In the paragraphs to follow, we have attempted to lay out our understanding of these tools after using them in the OSSL:

I. WEBMIN: "Webmin is a web-based interface for system administration for Unix. Using any browser that supports tables and forms (and Java for the File Manager module), you can setup user accounts, Apache, DNS, file sharing and so on." Webmin is very modular in design, allowing third-party developers to add support for a particular service or task relatively easily.  Many of the tasks involve easing or automating system administration tasks, or editing a configuration file using a specific syntax. Webmin is currently supported by OpenCountry, a company that sells Linux management solutions.  The OpenCountry website includes information about Webmin, including two variations of the system that they support.

  • Webmin Plus: Webmin Plus, is a version of Webmin supported by OpenCountry.  According to the website, the Webmin Plus version has been tested by the company and includes new features, specifically support for the back-up and restore application called Bacula (http://www.bacula.org/).  Webmin Plus is still freely distributed under a “Mozilla-type” license, and is downloadable via Sourceforge.
  • Webmin Pro: Last I checked, Webmin Pro had not yet been released, but the following is an excerpt about the product from the OpenCountry website: “...a commercially supported comprehensive product for the entire data center enabling centralized systems administration of mixed distributions, Linux and Windows!”

II. YAST: YaST (Yet another Setup Tool) is an OS installation and configuration utility used primarily in SUSE-based systems.  YaST typically serves as the primary control panel interface in, and can be used for a number of configuration tasks – such as adding and removing software, patch management, user management, device configuration and for configuring individual services and daemons.  Other common administration tasks such as obtaining system information and reading server logs is also possible via the YaST interface. All of the aforementioned YaST features are implemented as modules, each of which provide a specific functionality or perform certain tasks.  These tasks typically involve editing one or more text configuration files on the system in a specific format to configure a specific service or daemon.  On other Linux or UNIX-like systems, these tasks are typically performed manually via the command-line.

The YaST utility is very modular in its design, allowing Novell or other third-party providers to add modules into the YaST interface to configure a particular device or service.  Many of these modules work independently of each other, and as such are often packaged as individual RPM packages that may be added or removed depending on the software and devices that are installed on a system. YaST modules are written using a scripting language specific to YaST called YCP.  Other scripts, such as Perl or shell scripts can also be utilized via a YaST module to perform a particular task.  A CIM module for YaST is also distributed with SLES10, which provides a client interface for CIMOM (Common Information Object Manager) to other YaST2 modules. It seems the most common administration task for which YaST is used involves setting up individual package repositories (discussed further in the Patch Management and Maintenance), adding or removing software packages and configuring or initiating online updates. YaST is capable of searching for and locating software on remote repositories, retrieving the software packages, resolving package dependencies, checking the cryptographic signature of the package (if available) and then installing the software on the system.  Multiple repositories can be configured.  Repositories can be located on a hard disk or CD/DVD, or on a remote system obtainable via HTTP(s), FTP, NFS or CIFS. Once a repository is configured it can then be indexed for later searching.  The software search functionality is very powerful, allowing one to search for appropriate software packages using many of the attributes available in the RPM package header – such as the description or contents of the package. Besides software management, the quality and completeness of many YaST modules varies.  Many modules (such as the log viewing modules) offer minimal functionality, and only work well enough to provide a few basic configuration options.  Complex server configurations will therefore still require one to edit text-based configuration files by hand, or use another configuration engine for the task, such as Webmin.  However, many other common tasks, such as configuring display settings or a printer, can be done entirely via YaST.

III. SSH/SCP/SFTP: SSH (Secure SHell) is likely the most widely used remote administration tool for Linux and UNIX-based systems.  The typical SSH toolset includes the SSH client and server, as well as the SCP and SFTP client applications for copying files, both of which simply utilize the ssh binary on the backend.  The following excerpt is from the OpenSSH project home page: "OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions. Since most any task can be performed via the command-line, the OpenSSH utilities are likely the most critical component for a Linux administrator to have available.  The remote copy and command execution options allow one to build, deploy and run a script on a number of machines relatively quickly and securely.  OpenSSH is typically installed by default in most Linux-based distributions, although in some distributions the server may by default be disabled or blocked by the firewall. "Most common uses of SSH are:

  1. Remote Command Execution: One of the most common uses of the ssh utility is to run commands in remote machines
  2. Authentication: In order to log into, copy files or run commands on a remote host via ssh, one must first authenticate to the remote machine.  Local password authentication may be used without any particular configuration on the server.  Linux systems that support PAM (Pluggable Authentication Modules) may also use password authentication to authenticate using a number of mechanisms, including NIS, LDAP, Kerberos, or AD (Active Directory).Rather than requiring a user to manually type in a password, a more common authentication option is to use public key authentication.  A user’s public key must be inserted into a file on the remote host called authorized_keys before they are allowed to authenticate to that server.  This can often be done via the post installation procedures built into kickstart or autoyast.
  3. Tunneling other Applications: Another common application is to use SSH for tunneling other protocols.  This is often used to tunnel protocols that are not typically encrypted such as NFS or X11.  By using the –Y or –X switches with the ssh client application, one can “turn on” X11 tunneling, allowing graphical applications run on the remote machine to display locally on the administrators workstation.  For example, if one were to SSH into a SUSE-based system and run “yast2” via the command line, the YaST display would be tunneled via SSH and displayed on the local system – even though the actual application is running on the remote system.
  4. Cluster Management: When managing a number of Linux servers, such as a HPC cluster, it is typical to have a large number of systems with identical configurations.  To ease administration of these systems there have been a number of SSH-based utilities that allow one to run commands on multiple systems, or copy a file to multiple systems, in parallel.  The following utilities are all licensed under the GNU GPL.
    • ClusterSSH: ClusterSSH allows an administrator run to open a remote SSH session to a number of systems at once via a single terminal window, and run commands or alter configuration files on all the systems simultaneously.
    • PCP: PCP is a tool designed to copy files in parallel to multiple nodes in a cluster or server farm.
    • GEXEC: GEXEC is a tool that is somewhat complimentary to PCP that provides a parallel remote command execution system for large clusters.  The system includes a client and server, as well as a library that allows integration into third-party applications.
    • PSSH: PSSH is distributed as a suite of utilities that perform many of same functions as ClusterSSH, PCP and GEXEC.
    • pssh – Parallel SSH, similar to ClusterSSH or GEXEC.
    • pscp – Parallel SCP, allows one to copy files to multiples nodes in manner a similar to PCP.
    • prsync – The prsync utility automates running rsync on multiple nodes in parallel, essentially another method of copying files or entire directory trees to a number of remote nodes.
    • pnuke – The pnuke command can be used to kill a number of processes running on multiple nodes.
    • pslurp – The pslurp utility is similar to the pscp utility, except that it is designed to copy files from a set of hosts.  This allows one to copy, for example, a log file that exists on multiple nodes, to a local directory tree.

IV. Cfengine: “Cfengine, or the configuration engine is an autonomous agent and a middle to high level policy language and agent for building expert systems to administrate and configure large computer networks. Cfengine is designed to be a part of a computer immune system. It is ideal for cluster management and has been adopted for use all over the world in small and huge organizations alike.” Cfengine consists of a userspace application called cfagent and a host of other utilities that reads and parses a series of text configuration files and performs tasks on the host system based on the configuration.  The configuration syntax of Cfengine is actually a high-level policy language that allows cfagent to test the system’s configuration and perform corrective actions based on those tests.  For example, cfagent may test to assure that a certain line of text exists within a configuration file, and if not it will add the text and restart the associated service.  The cfagent utility is typically run on an hourly (or so) basis via cron, a task-scheduling application.  This assures that mis-configurations will be found and corrected within a reasonable time frame.

The policy simply tests to make sure an entry for user root exists within the /etc/shadow file, and also checks to make sure the password matches.  This assures that all systems have the same password for the root user. The configuration of Cfengine can become very complex, which would likely not surprise those who have had experience with the tool.  The structure of the policy language eases this dilemma a bit, as platform definitions can be made and inherited by other blocks to help determine the appropriate action to take. The configuration is essentially a high-level policy language, and thus the various tests must be built and scripted manually.  The toolset is, however, enormously powerful when implemented correctly.  But as with many open-source technologies, the learning curve can be quite steep, and one must study the complexities of the tool before it can be competently used in a production environment. A version of Cfengine has been ported to the Windows platform to run under Cygwin.   

editfiles:

                    # We have different passwords for lab systems and workstations.

       linux.shadowpasswords.md5passwords.(!workstations)::

{ /etc/shadow

    SetLine "root:$1$383J33RL$ XXXXXXXXXXXXXXXXXXXXXX:12984:0:99999:7:::"

    AppendIfNoLineMatching '^root:.*'

    LocateLineMatching '^root:.*'

    ReplaceLineWith “root:$1$383J33RL$ XXXXXXXXXXXXXXXXXXXXXX:12984:0:99999:7:::”

}

       linux.shadowpasswords.md5passwords.workstations::

{ /etc/shadow

    SetLine “root:$1$gcGWA0qS$YYYYYYYYYYYYYYYYYYYYYY:13027:0:99999:7:::”

    AppendIfNoLineMatching ‘^root:.*’

    LocateLineMatching ‘^root:.*’

    ReplaceLineWith “root:$1$gcGWA0qS$YYYYYYYYYYYYYYYYYYYYYY:13027:0:99999:7:::”

}

Example Cfengine policy to check the password for the root user.

The following example Cfengine policy checks for the existence and the contents of the /etc/cron.d/yast2-online-update file for SUSE systems.  If necessary it creates the file, and writes a cron entry into the file to schedule a daily check for updates and patches.  Upon completion, it then runs the command “/etc/init.d/cron restart” as defined in the suse.restartcrond definition.   

editfiles:

        suse::

                { /etc/cron.d/yast2-online-update

                  DefineClasses "restartcrond"

                  Umask 077

                  AutoCreate

                  BeginGroupIfNoLineMatching "^.*[\s\t]+root[\s\t]+online_update"

                      AppendIfNoSuchLine "30 3 * * * root online_update"

                  EndGroup

                }

shellcommands:

        suse.restartcrond::

                "/etc/init.d/cron restart"    

Example Cfengine policy to assure that SUSE systems check for updates daily.

And that does it for the “Systems Configuration” section As always, please let us know if you found the above mentioned useful and any comments/feedback you may have. Thank you for tuning into Port25.

Comments RSS
  1. einhverfr said:

    Interesting post. I would add two more system configuration tools that you may have overlooked. They are not extremely commonly used but they can be very helpful for managing Linux/UNIX systems: - NFS: When a large number of servers need to share the same configuration, sometimes it is helpful to put that configuration information on a networked file server. OpenAFS could be used for user-specific sharing and security or where NFS is not feasible due to bandwidth limitations, etc. CVS (or SVN): With these programs, you can create, test, and maintain configuration files for groups of servers with identical configuration. SSH-based update commands can be used to push out the new files. Better yet, you can track the changes which makes for easier troubleshooting when something goes wrong...

    posted at 09:28PM 05/25/2007
  2. communist said:

    Seems as if comments are disabled? Anyway imho the best way is to use ssh as you'll find that on almost any linux distro under the sun ;)

    posted at 11:55AM 05/30/2007
  3. einhverfr said:

    Two tools I would recommend using for larger environments with many similar Linux servers: 1) NFS or (more rarely) OpenAFS can be used to allow several servers with the same configuration to always have the same read-only copy available. This reduces the points of maintenance. A similar approach, using OpenAFS shares called "lockers" is behind the Athena approach to network management, though these lockers usually contain the entire applications, not just the configuration files. 2) CVS or SVN can be used to manage configuration files, merging changes between them, and more importantly tracking changes so that you know what changed when. This can be helpful for system configuration, change control, and even process control. And it can make troubleshooting a problem a whole lot easier.

    posted at 01:11PM 06/01/2007
  4. Hey Kishi, good summary! I'd love for you to check out our product as well and let us know what you think, and add it to this summary if you wish. You can find out more about our project at www.netdirector.org from there there is a link to download from SourceForge. Best, Greg Wallace

    posted at 11:13AM 06/03/2007
  5. einhverfr said:

    Sorry about the duplicate. I guess the comment count was not showing up on the front page.

    posted at 02:44PM 06/05/2007
  6. kishi said:

    einhverfr - as always, you continue to shed light on more prevalant and unique tools/apps and we're really grateful to you for brining this feedback to us. I'll make sure I look at OpenAFS and post something.

    posted at 10:37PM 06/07/2007
  7. kishi said:

    gregwallaceemu - I checked the site netdirector.org. VERY COOL .. I am impressed by the fact that its got an embedded Change Management Database built-in which is quite the need of the hour. THANK YOU for driving our awareness on that front.

    posted at 10:39PM 06/07/2007
  8. kishi said:

    communist - I checked again and comments should be enabled. Please sign-on and let us know if you have any additional feedback for us.

    posted at 10:41PM 06/07/2007
  9. kishi said:

    communist - I checked again and comments should be enabled. Please sign-on and let us know if you have any additional feedback for us.

    posted at 10:41PM 06/07/2007
  10. einhverfr said:

    Just some notes about how OpenAFS can be used for this sort of thing. Essentially there are two methods: shared configurations and lockers. Note that OpenAFS can only be used in Kerberos environments. . In Linux, all configuration is done through a file interface. Most software allows for files to be stored in arbitrary locations, and even when that is not possible, symlinks can be used for this sort of thing. . One approach is to use a shared file layer to ensure standardized configuration between nodes on a cluster. This way, only a couple of redundant copies of a configuration need to be maintained for a large number of hosts, and all hosts forcibly use the same configuration. NFS has been used for this in the past, but NFS's security is not very robust, so frequently read-only configurations would be used. . OpenAFS is similar to Microsoft's DFS in function. It is fully Kerberized, and this allows for a greater degree of control over who may alter the permissions (i.e. permissions can be safely assigned to users on the network, and not restricted to hosts). . In this paradigm, every server on a server farm would likely be hitting a couple of replicated file servers forcibly sharing the same configuration files. Thus most system configuration could be forcibly shared across the server farm. . This method is preferred when you have many different OS and OS versions in the existing server farm because you can make fewer assumptions about what is on each machine (only the configuration files are shared). . The other paradigm is called "lockers" and was pioneered by the Athena project. Again, it leverages OpenAFS as a distributed filesystem to create self-contained storage units called lockers. Each locker contains a program or set of programs and all necessary libraries and configuration files for its operation that cannot be safely assumed to be available on the host platform. . A user then mounts the locker, and can run the programs from within it. This works well for both desktop and server environments where you have a fairly narrow supported configuration. Though it can be adapted to work with more heterogeneous environments, this adds a greater degree of complexity to this method. . These methods don't work well for Windows because most Windows software assumes that configuration data will be stored locally in the registry. Thus shared application configurations, or software installed on a network drive and accessible globally is not as practical. . THis gets back to my point about Windows and *nix being fundamentally different to administrate. Windows is internally more integrated and provides only more loose coupling between systems, while *nix is more loosely woven internally, and so the systems are best thought of as "IT Legos."

    posted at 11:30PM 06/07/2007
Post a Comment
*
*