Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/INSTALL
blob: 96044fa7d124a3c8ba621c9ca7a4b8da2443ec27 (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
Install Instructions
--------------------

1. Install Python package.

    # python setup.py install

This will install Python module in Python path and `stats_consolidation_run`
script.

This package requires python-rrdtool (1.4.7) and SQLAlchemy (0.8.2).

Additionally, it requires a database driver which depends on RDBMS installed
in the system. For MySQL uses mysql-connector-python (1.0.10) and for
PostgreSQL psycopg2 (2.5.1).

    |------------|------------------------|----------------------|
    | RDBMS      | Library                | Dialect+driver       |
    |------------|------------------------|----------------------|
    | MySQL      | mysql-connector-python | mysql+mysqlconnector |
    | POstgreSQL | psycopg2               | postgres             |
    |------------|------------------------|----------------------|


2. Create database.

`stats_consolidation_run` recreates tables but the database must exist
previously.


3. Edit configuration file with appropriate values and install in default path.


This an example configuration file:

    [main]
    db_user=user
    db_pass=password
    db_name=database
    db_dialect=postgres

    rrd_path=/var/lib/sugar-stats/rrd
    log_path=/var/log
    log_level=debug

Then copy to default configuration path:

    # cp stats-consolidation.conf /etc/stats-consolidation.conf


4. Activate crontab.

Check the actual path of main script.

    $ which stats_consolidation_run
    /usr/local/bin/stats_consolidation_run

Configure the following entry on crontab with correct arguments:

    0 3 * * * root /usr/local/bin/stats_consolidation_run --db_user=user --db_pass=password db_name=database db_dialect=postgres rrd_path=/var/lib/sugar-stats/rrd log_path=/var/log