1) Create the PostgreStats database.
The PostgreStats database can be installed on whatever server you like. To create the database, enter below the existing PostgreSQL user who will be accessing the PostgreStats database. This will generate the script you'll use to create the PostgreStats database on that server.
2) Update the PostgreStats ps_conf.php file and log-in.
Once your PostgreStats database is created, open up ps_conf.php located in the scripts directory of your PostgreStats install. At the top, plug-in your PostgreStats database connect credentials (user, pass, and host). Note, this user should be the same user as you indicated above when creating your PostgreStats database.
3) Log-in to PostgreStats.
The above script will create your PostgreStats Admin account. Once you've updated postgrestats.conf in step 2, you'll now be required to log-in to your PostgreStats site on page refresh.
Your temporary username: postgrestats
Your temporary password: password
4) Insert server & database configurations.
You can now use the Servers & Databases interface to add new Servers & Databases to PostgreStats. When you insert a new Server, you'll then be able to add that server's databases to it. PostgreStats will then update statistics for each database on each server, each time statistics are updated VIA Cron (below).
5) Automate PostgreStats with Cron.
PostgreStats are updated each time ps_cron.php is executed. This file is located in the scripts directory of your PostgreStats install. Enterprise was designed to collect statistics at higher frequencies or as often as you'd like (EG: once per hour) but stats should be updated at least once per day with the last execution as close to midnight as possible. We recommend you run this cron-job as root only. To install the cron-job, su to root, enter crontab edit mode by typing "crontab -e" and insert your new cron-job as in these examples:
55 23 * * * /usr/bin/php /path/to/postgrestatsent/scripts/ps_cron.php
In the above example, root will execute ps_cron.php each night at 11:55pm. Be sure to update your path to PHP and your PostgreStats install directory path.
50 * * * * /usr/bin/php /path/to/postgrestatsent/scripts/ps_cron.php
In the above example, root will execute ps_cron.php at 50 minutes past each hour. Be sure to update your path to PHP and your PostgreStats install directory path.
It is recommended you first zero-out statistics on each database prior to running ps_cron.php. You can do this simply by logging into each database and issuing a "select pg_stat_reset();" query.