{"id":13647243,"url":"https://github.com/darold/pgcluu","last_synced_at":"2025-05-16T01:07:00.590Z","repository":{"id":11868854,"uuid":"14428845","full_name":"darold/pgcluu","owner":"darold","description":"PostgreSQL Cluster performances monitoring and auditing tool","archived":false,"fork":false,"pushed_at":"2025-01-31T14:29:14.000Z","size":12189,"stargazers_count":340,"open_issues_count":4,"forks_count":44,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-08T12:05:38.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pgcluu.darold.net/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"postgresql","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darold.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-15T16:10:26.000Z","updated_at":"2025-04-03T23:53:41.000Z","dependencies_parsed_at":"2023-01-11T20:17:13.208Z","dependency_job_id":"101ecab7-5c84-4901-ac80-aee53c7d72c4","html_url":"https://github.com/darold/pgcluu","commit_stats":{"total_commits":761,"total_committers":26,"mean_commits":29.26923076923077,"dds":0.2339027595269383,"last_synced_commit":"3008465b4db0757ec20a7f4b941d4403498573ba"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darold%2Fpgcluu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darold%2Fpgcluu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darold%2Fpgcluu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darold%2Fpgcluu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darold","download_url":"https://codeload.github.com/darold/pgcluu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:03:25.757Z","updated_at":"2025-05-16T01:06:55.582Z","avatar_url":"https://github.com/darold.png","language":"Perl","funding_links":[],"categories":["Perl"],"sub_categories":[],"readme":"NAME\n    pgCluu - PostgreSQL Cluster utilization\n\nDESCRIPTION\n    pgCluu is a PostgreSQL performance monitoring and auditing tool.\n\n    It is a Perl program used to perform a full audit of a PostgreSQL\n    Cluster and System performance. It is divided in two parts:\n\n    - A collector used to grab statistics on the PostgreSQL cluster using\n    the psql command line utility and sar from the sysstat package.\n\n    - A pure Perl grapher that will generate all HTML and charts output\n    without any requirements.\n\n    If you don't need system utilization reports or don't want to install\n    the sysstat package, you can disable it at command line. You will only\n    have reports about your PostgreSQL Cluster. If you are running pgCluu\n    from a central server using option -h to monitor remotely a PostgreSQL\n    Cluster, the call to sar is automatically disabled.\n\n    If you just want to have system utilization reports or generate graphs\n    from a sar data file, it's also possible.\n\nSYNOPSIS\n    PostgreSQL and System metrics collector.\n\n            pgcluu_collectd [options] output_dir\n\n    Report generator.\n\n            pgcluu [options] -o report_dir input_dir\n\nREQUIREMENT\n    pgCluu comes with two Perl scripts. You need a modern Perl distribution,\n    the psql client and the sar command line utility (sysstat). The sysstat\n    package is optional, you can still use pgCluu to generate reports about\n    your PostgreSQL Cluster without it.\n\n    Charts are rendered using a Javascript library so you don't need\n    anything else. Your browser will do all the work.\n\nINSTALLATION\n  Installation from package\n    Installation of pgCluu can be done through the PostgreSQL Global\n    Development Group (PGDG) repositories. See how to install the PGDG\n    repositories at the following URLs for Debian and Ubuntu:\n\n            https://wiki.postgresql.org/wiki/Apt\n\n    and Redhat, CentOs, Fedora, Scientific Linux and Oracle Enterprise\n    Linux:\n\n            https://yum.postgresql.org/\n\n    Once it is done you can simply install pgCluu with commands:\n\n            sudo apt install pgcluu\n            sudo yum install pgcluu\n\n    Look at the package information to know where files are specifically\n    installed. See next two chapters to see which default installation paths\n    are used.\n\n  Installation from sources\n    Download the tarball from GitHub and unpack the archive:\n\n            tar xzf pgcluu-3.x.tar.gz\n            cd pgcluu-3.x/\n            perl Makefile.PL\n            make \u0026\u0026 sudo make install\n\n    This will copy the Perl scripts pgcluu_collectd and pgcluu into\n    /usr/local/bin directory and the man page to\n    /usr/local/share/man/man1/pgcluu.1p.gz. Those are the default\n    installation directories for 'site' install on some well-known\n    distribution but the path could change.\n\n    If you want to install all under /usr location, use INSTALLDIRS='vendor'\n    as an argument of Makefile.PL. The script will be installed into\n    /usr/bin/pgcluu and the manpage into /usr/share/man/man1/pgcluu.1p.gz.\n\n    For example, to install everything just like Debian does, proceed as\n    follows:\n\n            perl Makefile.PL INSTALLDIRS=vendor\n\n    By default INSTALLDIRS is set to site.\n\n    The directory where statistics will be saved is /var/lib/pgcluu/data and\n    the default directory for reports is /var/lib/pgcluu/report.\n\n    The CGI script is installed into /var/lib/cgi-bin/pgcluu.cgi and the\n    Apache configuration file into /etc/apache/conf-available/pgcluu.conf.\n    This file allow acces to resources files (CSS and JS files) from\n    installation directory /usr/local/share/pgcluu/rsc/. Access is granted\n    to local user only by default.\n\n    All scripts (pgcluu_collectd, pgcluu and pgcluu.cgi) are reading\n    configuration file from /usr/local/etc/pgcluu.conf. This file is mainly\n    use by the CGI script but some directives are dedicated to\n    pgcluu_collectd and pgcluu script to define the retention days for\n    example.\n\n  Custom installation\n    The installation of pgCluu can be fully customized through environment\n    variables (RSCDIR,CGIDIR,CONFDIR,PIDDIR,STATDIR,APACHECONF,MANDIR,\n    DOCDIR,SYSTEMDDIR,RETENTION). These variables are passed to Makefile.PL\n    as command line arguments or can be exported as environment variables\n    before running \"perl Makefile.PL\".\n\n    The default values for these variables are:\n\n        DESTDIR     =\u003e /usr/local\n        INSTALLDIRS =\u003e site\n        CONFDIR     =\u003e DESTDIR/etc\n        PIDDIR      =\u003e /var/run/postgres\n        STATDIR     =\u003e /var/lib/pgcluu/data\n        REPORTDIR   =\u003e /var/lib/pgcluu/data\n        RSCDIR      =\u003e DESTDIR/share/pgcluu\n        CGIDIR      =\u003e /usr/lib/cgi-bin\n        APACHECONF  =\u003e /etc/apache2/conf-available\n        MANDIR      =\u003e DESTDIR/share/man\n        DOCDIR      =\u003e DESTDIR/share/doc\n        SYSTEMDIR   =\u003e DESTDIR/lib/systemd/system\n        RETENTION   =\u003e 0\n\n    If INSTALLDIRS is set to 'vendor':\n\n        CONFDIR     =\u003e /etc\n        DESTDIR     =\u003e /usr\n\n    The configuration file is auto-generated by the Makefile.PL script and\n    saved into CONFDIR/pgcluu.conf. If the destination file exists it is not\n    overridden. The file is also saved as example in the directory\n    DOCDIR/pgcluu/examples/pgcluu.conf.dist\n\n    The directory where pgcluu_collectd will store statistics is defined\n    with STATDIR which is by default /var/lib/pgcluu/data. The directory\n    where pgcluu will generate static html reports is defined by REPORTDIR.\n    The default is /var/lib/pgcluu/report. Both directory must be owned by\n    the postgres user.\n\n    The man page is saved as DESTDIR/share/man/pgcluu.1p.gz and a symbolic\n    link pgcluu_collectd.1p.gz is created to this file. The documentation,\n    README, changelog.gz, LICENSE files are saved under DESTDIR/share/doc/.\n\n    For the CGI mode, the resources (css and js files from the cgi-bin/rsc)\n    are saved under the DESTDIR/share/pgcluu/rsc directory. The CGI script\n    is saved under /usr/lib/cgi-bin/pgcluu.cgi. The Apache configuration\n    file under /etc/apache2/conf-available/pgcluu.conf with a symbolic link\n    /etc/apache2/conf-enabled/pgcluu.conf created to this file. Its content:\n\n        Alias /pgcluu RSCDIR/\n        \u003cDirectory RSCDIR/\u003e\n            Options FollowSymLinks MultiViews\n            AllowOverride None\n            Require local\n            #Require ip 192.1.168.0/24\n        \u003c/Directory\u003e\n\n    The systemd files (pgcluu_collectd.service,pgcluu.service,pgcluu.timer)\n    are saved as examples into DOCDIR/pgcluu/examples/ and into the systemd\n    directory SYSTEMDDIR/\n\n    The right path to the configuration file is set into all scripts pgcluu,\n    pgcluu_collectd and pgcluu.cgi. The path where the pid file must be\n    saved is replaced into pgcluu_collectd with the value of PIDFILE\n    variable.\n\n    Paths to scripts, pid directory, statistics and reports are replaced in\n    all systemd service files following the values of the environment\n    variable explain here.\n\nUSAGE\n   Manually\n    See next two chapters for a complete description of the command line\n    options. For the impatient, here some simple commands that could be run\n    as postgres user:\n\n            mkdir /tmp/stat_db1/\n            pgcluu_collectd -D -i 60 /tmp/stat_db1/\n            LOG: Detach from terminal with pid: 11323\n\n    or with more options\n\n            pgcluu_collectd -D -i 60 /tmp/stat_db1/ -h 10.10.1.1 -U postgres -d mydb\n            LOG: Detach from terminal with pid: 14671\n\n    wait some time and activity on your PostgreSQL Cluster... Then stop the\n    pgcluu_collectd daemon and generate the report:\n\n            pgcluu_collectd -k\n            LOG: Received terminating signal.\n            mkdir /tmp/report_db1/\n            pgcluu -o /tmp/report_db1/ /tmp/stat_db1/\n\n    You should obtain something like example at\n    http://pgcluu.darold.net/example/\n\n    By default all javascript, css and the webfont fontawesome are\n    automatically generated into the output directory if those files does\n    not already exits.\n\n   Using systemd unit files\n    pgcluu comes with systemd service files:\n\n        - pgcluu_collectd.service: execute pgcluu_collectd as a daemon to collect statistics.\n        - pgcluu.service: execute pgcluu to generate reports.\n        - pgcluu.timer: run periodically pgcluu.service\n\n    These files are installed automatically by the install script or the\n    package into /lib/systemd/system/. To activate these services proceed as\n    follow:\n\n            systemctl daemon-reload\n            systemctl enable pgcluu_collectd.service\n            systemctl enable pgcluu.service\n            systemctl enable pgcluu.timer\n            systemctl start pgcluu_collectd.service\n            systemctl start pgcluu.timer\n\n    Be warn that storing indefinitely statistics with pgcluu_collectd can\n    fill you disk space in the short or medium term. You have to remove\n    obsolete statistics manually using a cron job or using the embedded\n    retention feature by adding option '--retention ndays' to\n    pgcluu_collectd call or by changing the value of\n    STATS_COLLECTD_RETENTION configuration directive in file\n    /usr/local/etc/pgcluu.conf or /etc/pgcluu.conf file following your\n    installation. You can also set STATS_REPORT_RETENTION to limit the\n    retention of reports directories or use option '--retention ndays' with\n    pgcluu. Default is to preserve collected data for the past 30 days.\n\n    If you want to use the CGI mode you also have activate pgcluu caching by\n    enabling value STATS_REPORT_CACHING in the configuration file and using\n    pgcluu.service+pgcluu.timer. If you don\"t want to use systemd you can\n    simply run pgcluu script with the -C option and execute it periodically\n    through a cron job.\n\n    Note that the systemd service files set the privilege to the data and\n    report directory to user postgres and group www-data. By this way\n    reports are readable through an httpd server for static reports and data\n    are readable through the CGI if enabled. Command executed by the\n    pgcluu_collectd.service file (daemon part) are:\n\n            /bin/mkdir -p $STATDIR\n            /bin/chown postgres:www-data $STATDIR\n            /bin/chmod u=rwX,g=rsX,o= $STATDIR\n\n    The pgcluu.service file (client part) execute commands:\n\n            /bin/mkdir -p $REPORTDIR\n            /bin/chown postgres:www-data $REPORTDIR\n            /bin/chmod u=rwX,g=rsX,o= $REPORTDIR\n\n    In case you don't want to use systemd service files you will have to\n    execute these commands manually before tunning pgCluu.\n\n    For pgcluu reports, the output directory can be defined in the\n    configuration file using the STATS_REPORT_OUTDIR directive.\n\nCOLLECTING STATISTICS\n    To generate reports about your PostgreSQL Cluster Utilization you must\n    collect statistics before. pgcluu_collectd is here for that. It can be\n    run in a daemon mode (option -D) or in interactive mode for debugging\n    purpose. All you need is to provide a directory where data will be\n    stored. Statistics will be pooled at a default interval of 60 seconds,\n    using option -i you can customize it. See below for a complete list of\n    command line options.\n\n  pgcluu_collectd usage\n    usage: pgcluu_collectd [options] output_dir\n\n            output_dir: full path to directory where pgcluu_collectd will\n                        store statistics.\n\n    options:\n\n      -B, --enable-buffercache enable buffercache statistics if pg_buffercache\n                               extension is installed.\n      -c, --capture            create a snapshot of the PostgreSQL installation\n                               into tmp/pgcluu_capture.tar.gz.\n      -C, --end-counter=NUM    terminate program after NUM reports.\n      -d, --dbname=DATABASE    database name to connect to. Default to current user.\n      -D, --daemonize          detach from console and enter in daemon mode.\n      -E, --end-after=NUM      self terminate the program after a given number of\n                               seconds. Can be written: 7200 or 120M or 2H, for\n                               days use 7D for example to stop collecting data\n                               after seven days.\n      -f, --pid-file=FILE      path to pid file. Default: /var/run/postgresql/pgcluu_collectd.pid.\n      -h, --host=HOSTNAME      database server host or socket directory\n      -i, --interval=NUM       time to wait between runs\n      -k, --kill               stop current pgcluu_collectd running daemon.\n      -m, --metric=METRIC      set a coma separated list of metrics to perform.\n      -M, --max-size=SIZE      self terminate program when the size of the output\n                               directory exceed a given size. Can be written: 2GB\n                               or 2000MB.\n      -n, --no-pg_stats-dump   don't collect statistics from the pg_stats view.\n      -p, --port=PORT          database port(s) to connect to. Defaults to 5432.\n      -P, --psql=BIN           path to the psql command. Default: psql.\n      -Q, --no-statement       do not collect statistics from pg_stat_statements.\n      -r, --rotate-daily       force daily rotation of data files.\n      -R, --rotate-hourly      force hourly rotation of data files.\n      -s, --sar=BIN            path to sar sysstat command. Default: sar.\n      -S, --disable-sar        disable collect of system statistics with sar.\n      -t, --lock-timeout=NUM   terminate metric SQL query after N second in case it\n                               wait too much time because of a lock. Default: 3\n      -T, --no-tablespace      disable lookup at tablespace when the connect user\n                               is not superuser to avoid printing an error message.\n      -U, --dbuser=USERNAME    database user to connect as. Default to current user.\n      -v, --verbose            Print out debug informations.\n      -V, --version            Show pgcluu_collectd version and exit.\n      -w, --no-waitevent       don't collect wait event stats from pg_wait_sampling.\n      -W, --password=pass      database password.\n      -z, --compress           force compression of rotated data files.\n      --included-db=DATABASE   collect statistics only for those databases present\n                               in a comma separated list of database names.\n      --list-metric            list available metrics actions that can be performed.\n      --sysinfo                get operating system infos and exit (sysinfo.txt).\n      --no-sysinfo             do not collect operating system information at all.\n      --no-database            do not collect database statistics at all.\n      --pgbouncer-args=OPTIONS Option to used to connect to the pgbouncer system\n                               database. Ex: -p 6432 -U postgres -h 192.168.1.100\n                               You must at least give one parameter to enable\n                               pgbouncer monitoring.\n      --sar-file=FILE          path to sar output data file for sysstat stats\n                               Default to output_dir/sar_stats.dat.\n      --stat-type all|user     Set stats tables to read. Values: 'all' or 'user' to\n                               look at pg_stat_(all|user) tables. Default: user.\n      --pgversion X.Y          force the PostgreSQL version to the given value.\n      --pgservice NAME         Name of service inside of the pg_service.conf file.\n      --exclude-time RANGE     exclude a laps of time by giving the start and end\n                               hours.\n      --cron-user=USERNAME     collect crontab settings for the given username (in\n                               this case pgcluu_collectd need to be run as root).\n                               Default is to use USERNAME environment variable or\n                               postgres when it is not defined.\n      --package-list=CMD       command to list PostgreSQL packages. Default is to\n                               autodetect package type and using command 'rpm -qa'\n                               or 'dpkg -l'. If you have an other system you can\n                               set a custom command. A filter on keyword 'postgres'\n                               is appended to the command: ' | grep postgres'.\n      --retention NDAYS        number of rolling days to keep in data directory in\n                               incremental mode. Default is to store indefinitely.\n      --disable-pidstat        do not collect metrics from pidstat command.\n      --help                   print usage\n\n    Use those options to execute sar on the remote host defined by the -h\n    option, otherwise it will be executed locally:\n\n      --enable-ssh             activate the use of ssh to run sysstat remotely.\n      --ssh-program ssh        path to the ssh program to use. Default: ssh.\n      --ssh-user username      connection login name. Default to running user.\n      --ssh-identity file      path to the identity file to use.\n      --ssh-timeout second     timeout to ssh connection failure. Default 10.\n      --ssh-options  options   list of -o options to use for the ssh connection.\n                               Options always used:\n                                 -o ConnectTimeout=$ssh_timeout\n                                 -o PreferredAuthentications=hostbased,publickey\n\n    For example, as postgres user to monitor locally a full PostgreSQL\n    cluster:\n\n      mkdir /tmp/stat_db1/\n      pgcluu_collectd -D -i 60 /tmp/stat_db1/\n\n    to collect statistics from pgbouncer too, and limit database statistics\n    to a single database:\n\n      pgcluu_collectd -D -i 60 /tmp/stat_db1/ -h 10.10.1.1 -U postgres -d mydb \n                    --pgbouncer-args='-p 5342'\n\n    to disable statistics collect between 22:30 and 06:30 the next day:\n\n      pgcluu_collectd -D -i 60 /tmp/stat_db1/ --exclude-time \"22:30-06:30\"\n\n    to collect statistics from a remote server:\n\n        pgcluu_collectd -D -i 60 /tmp/statdb1/ -h 10.0.0.1 -U postgres --disable-sar\n\n    the same but with collecting system statistics using remote sar calls:\n\n      pgcluu_collectd -D -i 60 /tmp/statdb1/ -h 10.0.0.1 -U postgres --enable-ssh \n            --ssh-user postgres --ssh-identity /var/lib/postgresql/.ssh/id_rsa.pub\n\n    You may need a .pgpass and be able to establish passwordless ssh\n    connections to be able to collect statistics from remote hosts.\n\n    Then after some time and activities on the database, stop the daemon as\n    follow:\n\n      pgcluu_collectd -k\n\n    or by sending sigterm to the pgcluu_collectd's pid.\n\n    You can run the collector in incremental mode using a daily or a hourly\n    statistics rotation:\n\n      pgcluu_collectd -D -i 60 /tmp/stat_db1/ --rotate-daily\n\n    On a server with huge activity you may want to use --rotate-hourly and\n    compression mode with --compress option. If you have limited disk space\n    you can restrict the retention time of statistics files using option\n    --retention with the storage day limit.\n\n  Statistics files\n    The output directory with all statistics collected should look likes:\n\n            /tmp/stat_db1/\n            |-- commit_memory.csv\n            |-- end-pg_statio_user_indexes.csv\n            |-- end-pg_statio_user_sequences.csv\n            |-- end-pg_statio_user_tables.csv\n            |-- end-pg_stat_user_functions.csv\n            |-- end-pg_stat_user_indexes.csv\n            |-- end-pg_stat_user_tables.csv\n            |-- end-pg_stat_xact_user_functions.csv\n            |-- end-pg_stat_xact_user_tables.csv\n            |-- fs_stat_use.csv\n            |-- pg_class_size.csv\n            |-- pg_database_size.csv\n            |-- pg_db_role_setting.csv\n            |-- pg_hba.conf\n            |-- pg_ident.conf\n            |-- pg_nondefault_settings.csv\n            |-- pg_prepared_xact.csv\n            |-- pg_settings.csv\n            |-- pg_stat_archiver.csv\n            |-- pg_stat_bgwriter.csv\n            |-- pg_stat_connections.csv\n            |-- pg_stat_count_indexes.csv\n            |-- pg_stat_database_conflicts.csv\n            |-- pg_stat_database.csv\n            |-- pg_stat_hash_indexes.csv\n            |-- pg_stat_invalid_indexes.csv\n            |-- pg_statio_user_indexes.csv\n            |-- pg_statio_user_sequences.csv\n            |-- pg_statio_user_tables.csv\n            |-- pg_stat_locks.csv\n            |-- pg_stat_missing_fkindexes.csv\n            |-- pg_stat_redundant_indexes.csv\n            |-- pg_stat_replication.csv\n            |-- pg_stat_unlogged.csv\n            |-- pg_stat_unused_indexes.csv\n            |-- pg_stat_user_functions.csv\n            |-- pg_stat_user_indexes.csv\n            |-- pg_stat_user_tables.csv\n            |-- pg_stat_xact_user_functions.csv\n            |-- pg_stat_xact_user_tables.csv\n            |-- pg_tablespace_size.csv\n            |-- pg_xlog_stat.csv\n            |-- postgresql.auto.conf\n            |-- postgresql.conf\n            |-- sar_stats.dat\n            |-- sysinfo.txt\n\n    Then now you can proceed with pgcluu to generate reports.\n\n  Additional statistics from extensions\n    To be able to report top statements, wait events and subxact statistics\n    you need to create the related extensions into a single database and use\n    this database for primary connection to pgcluu_collectd using the -d\n    option.\n\n    The related extension are pg_stat_statements, pg_wait_sampling and\n    pg_subxact_counters.\n\n  Rotation and compression\n    When used the --rotate-daily or --rotate-hourly commands line option\n    will force pgcluu_collectd to rotate daily or hourly all statistic's\n    files. In this case, statistics files will be created in a subdirectory\n    based on rotation frequency, output_dir/year/month/day[/hour]. This is\n    called the incremental mode.\n\n    To save filesystem space it is possible to enable compression of all\n    rotated files during the rotation process. Just activate the -z or\n    --compress command line option. You can also use the --retention option\n    to set the storage time limit in days.\n\n  Incremental mode\n    This mode is enabled when --rotate-daily or --rotate-hourly command line\n    options are used. It allow pgcluu to build reports incrementally by days\n    or hours. In this mode you don't have to build reports per day or hour\n    pgcluu will do the work automatically, just give it the top statistics\n    directory.\n\n            pgcluu -o /var/www/pgcluu/reports/ /var/lib/pgcluu/data/\n\n    pgcluu will detect that --rotate-daily or --rotate-hourly have been used\n    to collect data and generate reports for each day or hours stored.\n    Previous directories already processed will not be processed again\n    unless this was the the last one.\n\n    The daily or hourly basis statistic storage also allow the use of the\n    CGI script pgcluu.cgi to have dynamic reports and temporal search. See\n    \"Using dynamic mode\" chapter.\n\n    When used the --rotate-daily or --rotate-hourly commands line option\n    will force pgcluu_collectd to rotate daily or hourly all statistic's\n    files. In this case, statistics files will be created in a subdirectory\n    based on rotation frequency, output_dir/year/month/day[/hour]. This is\n    called the incremental mode.\n\n    To save filesystem space it is possible to enable compression of all\n    rotated files during the rotation process. Just activate the -z or\n    --compress command line option. You can also use the --retention option\n    to set the storage time limit in days.\n\n  Capture mode\n    The goal of this mode is to be able to obtain a simple report about the\n    PostgreSQL installation without collected metrics others than database\n    and tablespace size. This report can be use by ITs to better understand\n    the configuration and things that need to be tuned.\n\n    To enable this mode, just run pgcluu_collectd with the single option -c\n    or --capture. Other command line options will not be taken in account.\n    pgcluu_collectd will create e temporary directory /tmp/pgcluu_capture to\n    store temporary data and will removed if after building a compressed tar\n    archive: /tmp/pgcluu_capture.tar.gz. This is this archive that can be\n    used with pgcluu to build a snapshot report of the instance. pgcluu will\n    automatically detect this mode.\n\nGENERATING REPORTS\n  Static HTML reports\n    To generate a pgCluu report about a PostgreSQL Cluster you must, at\n    least, have a directory that contains all data files generated by\n    pgcluu_collectd or pgstats. In this directory, if you have a file named\n    sar_stats.dat or sadc_stats.dat for binary sadc data file, it will be\n    taken to build report about system utilization. If you just want to make\n    a report from a sar file use the -i or -I options.\n\n    usage: pgcluu [options] [-i sar_file | -I sadc_file] [input_dir]\n\n            input_dir: directory where pgcluu_collectd or pgstats and sar data\n                       files are stored.\n\n    options: -b, --begin datetime start date/time for the data to be parsed\n    (time of current timezone). -C, --cache generate cache files only\n    (.bin), no html output. -d, --db-only dbname only report for the whole\n    cluster and the given database name. You can use it multiple time or\n    give a comma separated list of database name. -D, --device-only dev only\n    report I/O stats for a particular device You can use it multiple time or\n    give a comma separated list of device name, ex: sda,sdc. -e, --end\n    datetime end date/time for the data to be parsed (time of current\n    timezone). -i, --sar-file=FILE path to the sar text data file to read to\n    generate system reports. Default to input_dir/sar_stats.dat. -I,\n    --sadc-file=FILE sadc binary data file to read to generate system\n    reports. Default to input_dir/sadc_stats.dat. -n, --top-number Top\n    number of tables or indexes I/O stats to show. Default is set to top 10.\n    Set it to 0 to show all. -N, --network-only iface only report stats for\n    a particular network interface. You can use it multiple times or give a\n    comma separated list of network interfaces, ex: eth0,eth1. -o,\n    --output=DIR output directory -r, --reverse-date By default pgcluu look\n    at mm/dd/yy format in sar file. When enabled pgcluu will look at\n    dd/mm/yy format. -s, --sadf=BIN path to the sadf sysstat command used to\n    read the sadc binary data file. Default: /usr/bin/sadf. -S,\n    --disable-sar disable collect of system statistics with sar. -t,\n    --with-table table Only report for the whole tables and the given table\n    name. You can use it multiple time or give a comma separated list of\n    database name. -T, --no-table Do not report statistics related to\n    tables. -v, --verbose Print out debug informations. -V, --version Show\n    pgcluu version and exit. -x, --external-menu Save menu in menu.html and\n    load it into each report using w3-include-html attribut from w3.js. This\n    will only work if acces to HTML reports is through a Web server, not\n    using the file:// protocol. -z, --timezone +/-XX Set the number of\n    hour(s) from GMT of the timezone, Eg: -z +02 Usually autodetected. Use\n    this to adjust date/time from the sar output, pgcluu use GMT time to\n    draw charts. -Z, --stats-timezone +/-XX Set the number of hour(s) from\n    GMT of the timezone. Eg: -Z +02 Usually autodetected. Use this to adjust\n    date/time from the cluster and system stats output, pgcluu use GMT time.\n    --from-sa-file instruct pgcluu that file specified by the -i option uses\n    the standard system activity daily data file. --charset used to set the\n    HTML charset to be used. Default: utf-8. --retention NDAYS number of\n    rolling days to keep in report directory. Default is to store\n    indefinitely. --help print usage\n\n    For example, you can generate all HTML reports from data files stored\n    into /tmp/stat_db1/ with the following commands:\n\n            mkdir /tmp/report_db1/\n            pgcluu -o /tmp/report_db1/ /tmp/stat_db1/\n\n    If you just want reports of some databases, use the following:\n\n            pgcluu -o /tmp/report_db1/ /tmp/stat_db1/ --db-only \"db1,db2,db3\"\n\n    If you just want to create a report from a sar output file:\n\n            sar -p -A 10 60 \u003e /root/my_sar_file.txt\n            pgcluu -o /tmp/report_sar/ -i /root/my_sar_file.txt\n\n    or from a daily sa file:\n\n            sar -p -A -f /var/log/sa/sa18 \u003e /root/my_sar_file.txt\n            pgcluu -o /tmp/report_sar/ -i /root/my_sar_file.txt --from-sa-file\n\n    and from a sa binary file:\n\n            pgcluu -o /tmp/report_sar/ -i /var/log/sysstat/sa22\n\n    or the sa text file if you don't have the same version of sysstat:\n\n            pgcluu -o /tmp/report_sar/ -i /var/log/sysstat/sar23 --from-sa-file\n\n    If pgcluu_collectd have been run in incremental mode you can limit the\n    number of retention days used for the reports:\n\n            pgcluu -o /tmp/report_sar/ /tmp/stat_db1/ --retention 30\n\n    A static report will be built for each day or hour following the\n    rotation used with pgcluu_collectd.\n\n  Dynamic reports (CGI)\n    Dynamics reports are build by a CGI script named pgcluu.cgi that can be\n    found in the cgi-bin repository of the source code. It allow you to\n    select the time period to build reports and to look at all differents\n    reports for this period just as with static HTML reports. After\n    installation from sources or binary packages the CGI might be found in\n    /usr/lib/cgi-bin/pgcluu.cgi or /var/www/cgi-bin/pgcluu.cgi following\n    your distribution.\n\n    To use pgCluu in CGI mode, you need a Web server (here we use Apache)\n    and a cron task to build the cache periodically.\n\n    First enable CGI mode.\n\n            sudo a2enmod cgi\n            sudo service apache2 restart\n\n    Then the CGI need to find the statistics directory where pgcluu_collectd\n    mostly /var/lib/pgcluu/data/. The content of this repository must be\n    readable by the Apache user (www-data).\n\n    Take care to restrict access to your server and the CGI as information\n    about your database and server are exposed in the reports.\n\n    The CGI script, pgcluu.cgi, use resources files (CSS and javascript).\n    They are stored in the cgi-bin/rsc/ directory of the source\n    distribution. Install this repository onto the DocumentRoot of your Web\n    server, for example:\n\n            sudo mkdir /var/www/pgcluu/\n            sudo cp -rf cgi-bin/rsc /var/www/pgcluu/\n\n    Then edit /etc/pgcluu.conf, copy it from sources cgi-bin/pgcluu.conf if\n    it doesn't exists. Change the RSC_BASE and INPUT_DIR configuration\n    directive to match your installation. Here in our example:\n\n            RSC_BASE        /pgcluu/rsc/\n            INPUT_DIR       /var/lib/pgcluu/data\n\n    Now we can start the data collection. For the moment pgcluu.conf is only\n    read by the CGI pgcluu.cgi but this might change in the future.\n\n    To let pgCluu start collecting data, you can use the following command\n    (you can change it to however you like). We will need postgres user for\n    this.\n\n            sudo su - postgres\n            /usr/local/bin/pgcluu_collectd -D -i 60 --rotate-daily /var/lib/pgcluu/data\n\n    This will rotate you data daily. This is also the default in the systemd\n    service file.\n\n    Plugging the CGI directly to the CSV statistics files will result in\n    very slow generation reports. To improve speed caching must be used, you\n    must execute periodically pgcluu in cache mode. Run it manually the\n    first time\n\n            /usr/local/bin/pgcluu --cache /var/lib/pgcluu/data\n\n    then add a cron task to execute the command each five or ten minutes:\n\n            */5 * * * * /usr/local/bin/pgcluu --cache /var/lib/pgcluu/data\n\n    If you are using systemd pgcluu.timer service then caching can be\n    enabled using STATS_REPORT_CACHING directive. Enabling this mode\n    generate cache files (*.bin) in the statistics directory and disable\n    static HTML reports generation.\n\n    To see your reports, go to the following URL:\n\n            http://localhost/cgi-bin/pgcluu.cgi\n\n    Or change localhost by your fqdn server name.\n\n    Note that here pgcluu_collectd and pgcluu scripts are found in\n    /usr/local/bin/ which is the default for an installation from sources\n    but with an installation from binary package you might find them into\n    /usr/bin/.\n\n    The CGI mode allow you to select the period of time used to generate the\n    statistics reports. Using default pgcluu_collectd 60 seconds interval, a\n    daily graph will have 1440 points. Having too much timeseries to render\n    is not a good point for performances so we are limiting to the first\n    seven days of the selected period. This mean a maximum of 10080 points\n    for one week, this seems a safe limit. Feel free to increase or reduce\n    the limit following the server and client resources. This is controlled\n    by\n\n            MAX_RENDERED_DAYS       7\n\n    configuration directive in pgcluu.conf\n\nLICENSE\n    Copyright (c) 2012-2024, Gilles Darold\n\n    pgCluu is licenced under the PostgreSQL Licence a liberal Open Source\n    license, similar to the BSD or MIT licenses. That mean that all parts of\n    the program are open source and free of charge.\n\n            Permission to use, copy, modify, and distribute this software and its\n            documentation for any purpose, without fee, and without a written agreement\n            is hereby granted, provided that the above copyright notice and this\n            paragraph and the following two paragraphs appear in all copies.\n\n            IN NO EVENT SHALL Dalibo BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,\n            SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,\n            ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF\n            Dalibo HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n            Gilles Darold SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT\n            LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n            PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN \"AS IS\" BASIS,\n            AND Gilles Darold HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,\n            UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n\n    This is the case for both, pgcluu_collectd and the grapher pgcluu\n    programs.\n\nAUTHORS\n    pgCluu is an original development of Gilles Darold.\n\n    Some parts of the collector are taken from pgstats a C program writen by\n    Guillaume Lelarge and especially the SQL queries including the\n    compatibility with all PostgreSQL versions. See\n    https://github.com/gleu/pgstats\n\n    Btw pgCluu grapher is compatible with files generated by pgstats, sar\n    and sadc so you can use it independantly to graph those data. Some part\n    of the sar output parser are taken from SysUsage. See\n    http://sysusage.darold.net/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarold%2Fpgcluu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarold%2Fpgcluu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarold%2Fpgcluu/lists"}