summaryrefslogtreecommitdiffstats
path: root/doc/server/snapshots/index.txt
blob: a7e5940edf68782d84dab644c54871c422cab64a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
.. -*- mode: rst -*-

.. _server-snapshots-index:

===============
Bcfg2 Snapshots
===============

.. versionadded:: 1.0.0

This page describes the Snapshots plugin. Snapshots is deprecated, and
will be removed in a future release.

Before you begin
================

Make sure you have version 0.5 or greater of sqlalchemy.

On CentOS/RHEL 5
----------------

* Download a tarball of SQLAlchemy.
* Extract and build the RPM::

      tar xzf SQLAlchemy-0.5.6.tar.gz
      cd SQLAlchemy-0.5.6
      python setup.py bdist_rpm

* Copy the RPM in ``SQLAlchemy-0.5.6/dist/`` to your Yum repository,
  and rebuild the repository using ``createrepo``.
* Clear the Yum cache::

      sudo yum clean all

* Install SQLAlchemy::

      sudo yum install SQLAlchemy

* Manage the package in Bcfg2 as you would any other package.

Configuration
=============

* A database location needs to be added to ``bcfg2.conf``. Three drivers
  are currently supported; mysql, postgres, and sqlite. When using the
  sqlite driver, only the driver and database lines are required.

  * For MySQL::

        [snapshots]
        driver = mysql
        database = snapshots
        user = snapshots
        password = snapshots
        host = dbserver

  * For SQLite::

        [snapshots]
        driver = sqlite
        database = /var/lib/bcfg2/var/snapshots.sqlite

* The database needs to be initialized.::

      $ bcfg2-admin snapshots init
      2009-03-22 21:40:24,683 INFO sqlalchemy.engine.base.Engine.0x...3e2c PRAGMA table_info("connkeyval")
      PRAGMA table_info("connkeyval")
      2009-03-22 21:40:24,684 INFO sqlalchemy.engine.base.Engine.0x...3e2c ()
      ()
      2009-03-22 21:40:24,686 INFO sqlalchemy.engine.base.Engine.0x...3e2c PRAGMA table_info("package")
      PRAGMA table_info("package")
      2009-03-22 21:40:24,687 INFO sqlalchemy.engine.base.Engine.0x...3e2c ()
      ()
      .....
      COMMIT

* The Snapshots plugin needs to be enabled for the bcfg2-server (by adding
  Snapshots to the plugins line in ``/etc/bcfg2.conf``). Once done,
  this will cause the the server to store statistics information when
  clients run.

Using the reports interface
===========================

All hosts::

    $ bcfg2-admin snapshots reports -a

    ============= ========= ========================================== ============================
    Client        Correct   Revision                                   Time
    ============= ========= ========================================== ============================
    bcfg2client   True      f46ac7773712bd3c3cfb765ae5d2a3b2a37ac9b7   2009-04-23 11:27:54.378941
    ============= ========= ========================================== ============================

List bad entries for a single host::

    $ bcfg2-admin snapshots reports -b bcfg2client
    Bad entries:
     Package:nscd
     Package:cupsys
     File:/etc/ldap.conf

List extra entries for a single host::

    $ bcfg2-admin snapshots reports -e bcfg2client
    Extra entries:
     Package:python-pyxattr
     Package:librsync1
     Package:python-pylibacl
     Package:gcc-4.2-multilib
     Package:nxlibs
     Package:freenx-session-launcher
     Package:dx-doc
     Package:dirdiff
     Package:libhdf4g
     Package:nxclient
     Package:freenx-rdp
     Package:freenx-vnc
     Package:libxml2-dev
     Package:mysql-client
     Package:mysql-client-5.0
     Package:libxcompext3
     Package:lib32gomp1
     Package:dx
     Package:freenx-media
     Package:dxsamples
     Package:gcc-multilib
     Package:rdiff-backup
     Package:libdbd-mysql-perl
     Package:libxcomp3
     Package:freenx-server
     Package:smbfs
     Package:planner
     Package:nxagent
     Package:libc6-dev-i386
     Package:libfltk1.1-dev
     Package:freenx
     Package:libdx4
     Package:libxcompshad3
     Service:freenx-server

Detailed view of hosts for a particular date::

    $ bcfg2-admin snapshots reports --date 2009 5 30
    ============= ========= ========================================== ============================
    Client        Correct   Revision                                   Time
    ============= ========= ========================================== ============================
    bcfg2client   False     10c1a12c62c57c0861cc453b8d2640c4839a7357   2009-05-29 10:52:34.701056

TODO/Wishlist
=============

* Identify per-client changes in correctness over time
* Detailed view for a particular date
* Track entry changes over time (glibc updated on these dates to these versions)