Codebase list metche / 01ed651
01ed651

Tree @01ed651 (Download .tar.gz)

metche - reducing root bus factor
homepage : https://poivron.org/dev/metche/

,-------------------------------------------------------------------------------
| Copyright (C) 2004-2006 boum.org collective - property is theft !
`-------------------------------------------------------------------------------

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.

,-------------------------------------------------------------------------------
| OVERVIEW
`-------------------------------------------------------------------------------

metche is a tool meant to facilitate collective sysadmin ; basically, it
periodically :
   - saves the "system state" to $BACKUP_DIR, i.e. :
      . $WATCHED_DIR (default: /etc)
      .    $CHANGELOG_FILE (default /root/Changelog)
        or $CHANGELOG_DIR/*/Changelog (default: /root/changelogs/*/Changelog)
      . Debian packages states and versions (using apt-show-versions)
   - sends you, in a nicely formated email, the "system state" changes ; see
     https://poivron.org/dev/metche/ for an example.

,-------------------------------------------------------------------------------
| BASIC USAGE
`-------------------------------------------------------------------------------

When installed and configured, metche is run by cron, and you just have to read
the report emails. Of course, it's not useful at all if you don't :
   - set $EMAIL_ADDRESS config variable to your sysadmin collective mailing-list
     address ;
   - use the Changelog files in a rigorous way.

Note: it is dangerous to use metche without before reading the SECURITY section
of the manpage.

For a deeper explanation of the way metche works, read the metche(8) manpage.

,-------------------------------------------------------------------------------
| REQUIREMENTS
`-------------------------------------------------------------------------------

1. Debian GNU/Linux and apt-show-versions (if Debian packages monitoring is
   enabled)
2. mutt
3. bzip2
4. If you want metche to encrypt the email it sends you : gnupg
5. If you want metche to monitor your vservers as well : util-vserver tools
6a. If you want metche to monitor one manually written Changelog file,
    it must be located at $CHANGELOG_FILE.
6b. If you want metche to monitor multiple manually written Changelog
    files, they must be located in $CHANGELOG_DIR/*/Changelog ;
    for example, you can have :
       /root/
           changelogs/
               common/Changelog
               apache/Changelog
               postfix/Changelog

,-------------------------------------------------------------------------------
| INSTALLATION
`-------------------------------------------------------------------------------

See the included INSTALL file.

,-------------------------------------------------------------------------------
| CONFIGURATION
`-------------------------------------------------------------------------------

*** Without vservers support

1. Copy metche.conf.default to /etc/metche.conf and edit it so that it suits
   your needs.
2. Read the next sections of this document and the metche(8) manpage.
3. Add to /etc/cron.d/metche something like :
     0-59/5 * * * * root test -x /usr/local/sbin/metche && \
      /usr/local/sbin/metche cron

*** With vservers support

You need one config file per system to be monitored (usually one for the host
system, and one per vserver). The "-h <host>" command-line option makes metche
use /etc/metche/<host>.conf config file instead of /etc/metche.conf.

1. mkdir /etc/metche
2. For each system to monitor, follow the next steps (replacing <host> by this
   host's name) :
     - copy metche.conf.default to /etc/metche/<host>.conf
     - edit <host>.conf so that it suits your needs
     - if the system to monitor is a vserver, edit <host>.conf to set
       VSERVER_EXEC_PREFIX to something like "/usr/sbin/vserver <host> exec"
3. Read the next sections of this document and the metche(8) manpage.
4. For each system to monitor, add to /etc/cron.d/metche something like :
     0-59/5 * * * * root test -x /usr/local/sbin/metche && \
       /usr/local/sbin/metche -h <host> cron

,-------------------------------------------------------------------------------
| SECURITY : BIG FAT WARNING
`-------------------------------------------------------------------------------

Read the SECURITY section of metche(8). Really.

,-------------------------------------------------------------------------------
| FAQ
`-------------------------------------------------------------------------------

1. How are the monitored Changelog files ($CHANGELOG_FILE or
   $CHANGELOG_DIR/*/Changelog) generated ?

   With Emacs or Vim. Ah ah. They are written by *you* ! They are an important
   part of the collective sysadmin process metche is supposed to facilitate.

2. Hey, how is metche working, and what are the underlying concepts I have to
   know ?

   When called with the "cron" command line switch, metche looks if the "system
   state" has changed in the last $TESTING_TIME minutes. If it is the case, a
   "unstable state" is saved. Otherwise, a "testing state" is saved, and a
   report is emailed to you.

   A similar mechanism to automatically turn a "testing state" into a "stable"
   one ; see metche(8) for explainations.

3. How do I see the saved states list ?

   Run "metche [-h <host>] list".
   If '-h <host>' option is specified, /etc/metche/<host>.conf will be used.

4. I've broken my system, how can I see a report against a previous, known
   working, system state ?

   Run "metche [-h <host>] report [{stable,testing,unstable}-YYYYMMDDHHMM]".
   If no saved state is specified, the latest "testing state" is used as
   reference.
   If '-h <host>' option is specified, /etc/metche/<host>.conf will be used.

5. How do I create a "stable state" by hand ?

   Run "metche [-h <host>] stabilize [testing-YYYYMMDDHHMM]".
   This turns the given testing state, if specified, or the latest one,
   otherwise, into a "stable state".

Commit History @01ed65165cbd902d0818f2c6f8b850125f1268cf