Windows Systemadministration mit UNIX-Werkzeugen

Logo

UNIX-Stammtisch

Matthias Clauß

Andreas Heik

TU CHEMNITZ, UNIVERSITÄTSRECHENZENTRUM

28. März 2006

Quelle: Titelbild Linux-Magazin 12/2002

ToSCA - Toolbox for System Configuration and Administration

Motivation

(wesentliche) Entwurfsziele

ToSCA-Funktionsumfang

ToSCA-Funktionsumfang

wesentliche ToSCA-Konzepte

Systemplattformen

Systemplattform: spezifiziert grundsätzliche Attribute eines ToSCA-administrierten Rechnersystems
ToSCA-Notation: <DISTRIBUTOR>_<BSVersion>_<ARCH>
vollständige SystembezeichnungBetriebssystemVersionArchitekturToSCA-Notation
Windows XP (32-Bit-Intel-Architektur)WXP5.1X86WXP_5.1_X86
Red Hat Enterprise 4, Update 3 (AMD64 bzw. Intels EM64T)RH4.3x86_64RH_4.3_x86_64
Linux Fedora Core 5 (PowerPC)FC5ppcFC_5_ppc
Scientific Linux 3.0.5 (Intel Itanum IA64)SL3.0.5ia64SL_3.0.5_ia64

Klassen

Klassen gewährleisten die korrekte Adressierung von Aktionen, Konfigurationsfiles, ToSCA-Repositories durch die ToSCA-Tools (cfengine, etc.)

Real World Hostinfos

Real World Hostinfos: alle nicht automatisch erfassbaren und änderbaren Zustandsinformationen für ein Rechnersystem (Host)
allgemeine Syntax:

<sp>:<fu_klasse>:<nkz_fuv_1>[,<nkz_fuv_2>,...]:<hostname>.<domaene>:<gebäude[,raum]>:<einrichtung>[,<lehrstuhl>]:<nkz_ap_1>[,<nkz_ap_2>,...]:


a)    WXP_5.1_X86:FU_CH_PCH_WS:czi,stb:regenbogen.chemie:na,B14A:CH,PCH:elkl,ggo:
      ^           ^            ^       ^                 ^       ^      ^
      |           |            |       |                 |       |      |
      |           |            |       |                 |       |      |
Systemplattform   |        FU-Admins   |           Standort      |      Ansprechpartner
                FU-Klasse            Host.Domain            Einrichtung

b)    W2003_5.2_X86:FU_UB_LIBERO_TS_SERVER:hot,jamar:schwarzkopf.bibliothek:na,060:UB:hot,jamar:

c)    SL_4.2_x86_64:FU_FTP_SERVER:fischer,fri:arges.hrz:na,060:URZ,DK:fischer,fri:

Beispiele für RWH-Einträge

Repositories (I)

Repositories: über Klassen adressierte ToSCA-Verzeichnishierarchien, z.B.:
$ tree -L 1 /afs/tu-chemnitz.de/ToSCA/
/afs/tu-chemnitz.de/ToSCA/
|-- CFENGINE
|-- CVS
|-- DATA
|-- LOGS
|-- ROOTS
|-- SAVECFENGINE
|-- SAVELOGS
|-- SAVEROOTS
|-- SCRIPTS
`-- SW
ToSCA-Repositories

Repositories (II)

ROOT-Repositories: für jede definierte Klasse wird eine Verzeichnishirearchie aufgespannt, die genau jene Prototypen von Konfigurationsfiles enthält, die diese Klasse von anderen Klassen unterscheiden
/afs/tu-chemnitz.de/ToSCA/ROOTS                       | Erläuterung:
                                                      |
|-- LINUX                                             | OS-Familie Linux
|-- SL_4                                              | SL_4 - unabhängig von Architektur und Minor-Release
|-- SL_4_X86                                          | SL_4_X86 - unabhängig von Minor-Release
|-- SL_4.2_X86                                        | SL_4.2_X86 
|-- ...                                               |
|-- NT                                                | NT - für alle Windows-BS
|-- W2003_5.2_X86                                     |     
|-- W2K_5.00_X86                                      |
`-- WXP_5.1_X86                                       |
ROOT-Repositories werden für OS-Familien und Systemplattformen aufgespannt
/afs/tu-chemnitz.de/ToSCA/ROOTS/SL_4.2_X86            | Erläuterung:
                                                      |
|-- ROOT4ANY                                          | für alle SL_4.2_X86-Rechner 
|-- CFU_DESKTOP                                       | für alle Desktop-Rechner (Pools, Arbeitsplätze, ...)
|   `-- etc                                           |
|       `-- rpm_accept.global.conf                    | Mindest-Software für Desktop-Rechner
|-- CFU_POOL                                          |
|   `-- etc                                           |
|       `-- rpm_accept.spec.conf                      | spezielle Software für alle Poolrechner
|-- ...                                               |
|-- FU_POOL_SN_207                                    | Konfigfiles für den Pool StraNa, Raum 207
|-- ...                                               |
|-- elbling                                           | spezielle Konfigfiles für den Pool-Rechner elbling


ROOT-Repositories für Systemplattform SL_4.2_X86
/afs/tu-chemnitz.de/ToSCA/ROOTS/SL_4.2_X86/elbling    | auf Rechner elbling:
                                                      |
|-- etc                                               |
|   |-- X11                                           |
|   |   `-- xorg.conf                                 | /etc/X11/xorg.conf
|   |-- crontab                                       | /etc/crontab
|   |-- daemon.local.conf                             | /etc/daemon.local.conf
|   |-- printcap.local                                | /etc/printcap.local
|   |-- rpm_accept.local.conf                         | /etc/rpm_accept.local.conf
|   |-- sudoers.global                                | /etc/sudoers.global
|   `-- sudoers.local                                 | /etc/sudouers.local
`-- usr                                               |
    `-- local                                         |
        `-- bb                                        |
            `-- etc                                   |
                `-- bb-dftab                          | /usr/local/bb/etc/bb-dftab
ROOT-Repository für Rechner elbling

Softwaremanagement

ToSCA-SW-Management basiert auf
/afs/tu-chemnitz.de/ToSCA/SW/URZ_CONTRIB

|
|-- ...
|-- anhe
|   |-- LINUX
|   |-- ...
|   |-- SL_4.2_X86
|   |-- SL_4_X86
|   |-- ...
|   |-- NT
|   |   |-- flash_player-8.0.24-1         ------+
|   |   |-- ...                                 |   
|   |                                           |   - Paketbau
|   |-- W2003_5.2_X86                           |   - Testung
|   `-- WXP_5.1_X86                             |   - Freigabe zur Verteilung
|                                               |
`-- STANDARD                                    |
    |-- LINUX                                   |   - Kopieren 
    |-- ...                                     |   - evtl. Löschen alte Version
    |-- SL_4.2_X86                              |   - evtl. Eintragen in 
    |-- SL_4_X86                                |     wpm_accept.{global,spec,local}.conf
    |-- ...                                     |
    |-- NT                                      |
    |   |-- flash_player-8.0.24-1        <------+
    |   |-- ...
    |   
    |-- W2003_5.2_X86
    `-- WXP_5.1_X86
Softwarebereitstellung in URZ_CONTRIB

Windows Systemadministration

Welche Einstellungen werden zentral gepflegt?

Software- und Systemeinstellungen

Wie und wo werden Software- und Systemeinstellungen festgelegt?

cfengine (I)

cfengine als ToSCA-Werkzeug:

Voraussetzungen

Build

$ tar xvfz db-4.4.20.tar.gz
$ cd db-4.4.20/build_unix/
$ ../dist/configure
$ make
$ make install

$ tar xvfz cfengine-2.1.15.tar.gz
$ cd cfengine-2.1.15
$ patch -p1 <../patch.cfengine_nontsec
$ patch -p1 <../patch.cfengine_MOUNT_RO
$ mkdir lib
$ ln -s /usr/lib/libcrypto.a lib/
$ LIBS=-L$(pwd)/lib ./configure --with-berkeleydb=/usr/local/BerkeleyDB.4.4/
$ make
$ make install$

Beachte:

cfengine (II)

Installation

$ /usr/local/sbin/cfkey.exe
Making a key pair for cfengine, please wait, this could take a minute...
Writing private key to /var/cfengine/ppkeys/localhost.priv
Writing public key to /var/cfengine/ppkeys/localhost.pub
cfengine Schlüsselpaar erzeugen

Konfiguration

linux.!nt::
  access         = ( root )
nt.!linux::
  access         = ( system )

linux.!nt::
  ROOT_DEST = ( / )
nt.!linux::
  ROOT_DEST = ( c:// )
plattformspezifische Unterschiede in cfengine-Konfiguration

Startscript cfagent

cfengine (III)

zeitgesteuerter Start

beim Systemstart

auf Anforderung (remote)

cfengine in Aktion

Synchronisieren von Files

Synchronisieren von Registryschlüsseln

Ausführen von Scripts

Notifikation

===BEGIN=balling=SYSTEM=Wed Mar 15 03:14:01     2006====
cfagent-OPTIONS=-b --no-lock --inform -DDaily -DMOTD -DWXP_51 -DWXP_51_X86 -DWXP_51_X86 -NFC_1_X86 -NFC_4_X86 -NSL_3_ia64 -NSL_3_X86 -NSL_4_X86 -NSL_4_x86_64 -NSL_302_ia64 -NSL_305_X86 -NSL_42_X86 -NSL_42_x86_64 -NFC_1 -NFC_4 -NSL_3 -NSL_4 -NW2K_500_X86 -NW2003_52_X86 -NDACS_2_X86 -NDACS_2 -NDACS_20_X86
cfengine:balling: Update of image /cygdrive/c\windows\system32\repl\import\scripts\check_token.sh from master //afs/tu-chemnitz.de/ToSCA/ROOTS/NT/CFU_DESKTOP\windows\system32\repl\import\scripts\check_token.sh on localhost
cfengine:balling: Update of image /cygdrive/c\windows\local\registry\bigbrother_ignoremsgs.reg from master //afs/tu-chemnitz.de/ToSCA/ROOTS/NT/ROOT4ANY\windows\local\registry\bigbrother_ignoremsgs.reg on localhost
cfengine:balling: Executing script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/registry_import.sh...(timeout=0,uid=-1,gid=-1)
cfengine:balling: Finished script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/registry_import.sh
cfengine:balling: Executing script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/gpupdate.sh...(timeout=0,uid=-1,gid=-1)
cfengine:balling: Finished script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/gpupdate.sh
cfengine:balling: Executing script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/host_info.sh...(timeout=0,uid=-1,gid=-1)
cfengine:balling: Finished script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/host_info.sh
cfengine:balling: Executing script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/merge_conf.sh c:/windows/local/etc/wpm_accept.conf...(timeout=0,uid=-1,gid=-1)
cfengine:balling: Finished script /bin/bash //afs/tu-chemnitz.de/ToSCA/SCRIPTS/NT/merge_conf.sh c:/windows/local/etc/wpm_accept.conf
===END  =balling=SYSTEM=Wed Mar 15 03:14:53     2006====
Auszug cfagent-Logging

Logging

Scriptausführung

Hostinformationen

Softwareinstallation (I)

Motivation für den Betrieb der Windows-Plattform ist die Bereitstellung von Software.

Voraussetzung

Windows Package Manager (WPM)

Softwareinstallation (II)

WPM-Pakete

$ wpm -qi notepad2
Name:          notepad2
Version:       1.0.12
Release:       2
Install Date:  2006-03-27 08:44:27
Group:         Application/Editor
License:       GPL
URL:           http://www.flos-freeware.ch/notepad2.html
Summary:       Yet another Notepad replacement...
Bsp: wpm-Paketverwaltung

auto_wpm

Administrationswerkzeuge

Systemadministration

Softwareverwaltung

Fazit

statistische Informationen

Stand: März 2006

Probleme

Links




Vielen Dank für die Aufmerksamkeit!