commit 6374cded16f196c337b2e9fd3a0da2dc35fc5fbbf87d22008b3e8a476d991d3c Author: Reinhard Max Date: Thu Nov 16 17:45:27 2023 +0000 osc copypac from project:server:database:postgresql package:PgBadger revision:25 OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/pgbadger?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/PgBadger-rpmlintrc b/PgBadger-rpmlintrc new file mode 100644 index 0000000..70c1330 --- /dev/null +++ b/PgBadger-rpmlintrc @@ -0,0 +1 @@ +addFilter("missing-dependency-to-crontabs") \ No newline at end of file diff --git a/PgBadger.changes b/PgBadger.changes new file mode 100644 index 0000000..07e0c84 --- /dev/null +++ b/PgBadger.changes @@ -0,0 +1,288 @@ +------------------------------------------------------------------- +Thu Nov 16 16:44:33 UTC 2023 - Emiliano Langella + +- modified Source0 + +------------------------------------------------------------------- +Thu Nov 16 08:23:20 UTC 2023 - Emiliano Langella + +- added rpmlint filter for crontabs + +------------------------------------------------------------------- +Wed Nov 15 20:34:19 UTC 2023 - Emiliano Langella + +- removed clean macro + +------------------------------------------------------------------- +Wed Nov 15 10:11:49 UTC 2023 - Emiliano Langella + +- alligned changes file to the OBS project name + +------------------------------------------------------------------- +Wed Nov 15 09:55:46 UTC 2023 - Emiliano Langella + +- alligned "Name:" tag and spec file name to the OBS project name + +------------------------------------------------------------------- +Sat Aug 26 05:25:19 UTC 2023 - Marcus Rueckert + +- update to 12.2 + https://github.com/darold/pgbadger/releases/tag/v12.2 + +------------------------------------------------------------------- +Wed Mar 22 00:45:29 UTC 2023 - Marcus Rueckert + +- update to 12.1 + https://github.com/darold/pgbadger/releases/tag/v12.1 + +------------------------------------------------------------------- +Tue Sep 13 22:30:31 UTC 2022 - Marcus Rueckert + +- update to 12.0 + https://github.com/darold/pgbadger/releases/tag/v12.0 + +------------------------------------------------------------------- +Sat Jul 16 01:06:50 UTC 2022 - Marcus Rueckert + +- update to 11.8 + https://github.com/darold/pgbadger/releases/tag/v11.8 +- drop 716.diff: + included in update + +------------------------------------------------------------------- +Sat Feb 19 17:48:06 UTC 2022 - Hans-Peter Jansen + +- apply upstream test fix 716.diff + https://github.com/darold/pgbadger/pull/716 + +------------------------------------------------------------------- +Tue Jan 25 10:41:34 UTC 2022 - Marcus Rueckert + +- update to 11.7 + https://github.com/darold/pgbadger/releases/tag/v11.7 + +------------------------------------------------------------------- +Tue Sep 7 16:36:46 UTC 2021 - Marcus Rueckert + +- update to 11.6 + https://github.com/darold/pgbadger/releases/tag/v11.5 + https://github.com/darold/pgbadger/releases/tag/v11.6 + +------------------------------------------------------------------- +Tue Dec 1 11:00:41 UTC 2020 - Marcus Rueckert + +- update to 11.4 + https://github.com/darold/pgbadger/releases/tag/v11.2 + https://github.com/darold/pgbadger/releases/tag/v11.3 + https://github.com/darold/pgbadger/releases/tag/v11.4 + +------------------------------------------------------------------- +Wed Oct 23 19:54:32 UTC 2019 - Marcus Rueckert + +- BR for cron for directory ownership + +------------------------------------------------------------------- +Wed Oct 2 08:18:11 UTC 2019 - lars@linux-schulserver.de + +- update to 11.1 + - please refer to /usr/share/doc/packages/pgbadger/ChangeLog for a + complete list of changes. The following is just an excerpt + + - This new release breaks backward compatibility with old binary or JSON + files. This also mean that incremental mode will not be able to read + old binary file. If you want to update pgBadger and keep you old reports + take care to upgrade at start of a new week otherwise weekly report will + be broken. pgBadger will print a warning and just skip the old binary + file. + - From 9.0: This major release of pgBadger is a port to bootstrap 3 and + a version upgrade of all resources files (CSS and Javascript). + There's also some bugs fixes and features enhancements. + + - Add support of pgbouncer syslog log file format. + - Add support to all auto_explain format (text, xml, json and yaml). + - Add support to %q placeholder in log_line_prefix. + - Add jsonlog format of Michael Paquier extension, with -f jsonlog + pgbadger will be able to parse the log. + - Add report of checkpoint distance and estimate. + - Add support of AWS Redshift keywords to SQL code beautifier. + - Add autodetection of log format in remote mode to allow remote + parsing of pgbouncer log file together with PostgreSQL log file. + - Replace the SQL formatter/beautify with v3.0 of pgFormatter. + - Add report of error class distribution when SQLState is available + in the log_line_prefix (see %e placeholder). + - Update SQL Beautifier to pgFormatter v1.6 code. + - Improve error message normalization. + - Add --normalized-only option to generate a text file containing all + normalized queries found in a log with count. + - Allow %c (session id) to replace %p (pid) as unique session id. + - Add waiting for lock messages to event reports. + - Add --start-monday option to start calendar weeks in Monday + instead of default to Sunday. + - Add report of top N queries that consume the most time in the + prepare or parse stage. + - Add report of top N queries that consume the most time in the + bind stage. + - Add report of timing for prepare/bind/execute queries parts. + Reported in a new "Duration" tab in Global Stats report. This + also fix previous report of "Total query duration" that was + only reporting execute total duration. + - Add support to RDS and CloudWatch log format, they are detected + automatically. You can use -f rds if pgbadger is not able to + auto-detect the log format. + - Add new configuration option --month-report to be able to build + monthly incremental reports. + - Add top bind queries that generate the more temporary files. + Require log_connection and log_disconnection be activated. + - Add --exclude-client command line option to be able to exclude log + entries for the specified client ip. Can be used multiple time. + - Add -H, --html-dir option to be able to set a different path where + HTML report must be written in incremental mode. Binary files stay + on directory defined with -O, --outdir option. + - Add -E | --explode option to explode the main report into one + report per database. Global information not related to a database + are added to the postgres database report. + - Add per database report to incremental mode. In this mode there + will be a sub directory per database with dedicated incremental + reports. + - Add support to Heroku's PostgreSQL logplex format. +- needs Pod::Markdown and JSON::XS to build now +- uses additional modules during runtime: Storable, File::Spec, File::Temp + IO::Handle, IO::Pipe, FileHandle, Socket, Encode, Text::Wrap +- new upstream URL +- disable tests on SLE, as there is no JSON::XS available +- added some cron examples in /etc/cron.d/pgbadger + +------------------------------------------------------------------- +Mon Apr 25 15:00:48 UTC 2016 - mrueckert@suse.de + +- update to 8.1 + - Fix one case where pid file remain after dying. + - Add requirement of log_error_verbosity = default to + documentation. + - Report message "LOG: using stale statistics instead of current + ones because stats collector is not responding" in events view. + - Remove obsolete days when we are in binary mode with --noreport + - Fix wrong report of statements responsible of temporary files. + Thanks to Luan Nicolini Marcondes for the report. This patch + also exclude line with log level LOCATION to be parsed. + - Fix limit on number of sample at report generation and remove + pending LAST_PARSED.tmp file. + - Update load_stat() function and global variables to support + pgbouncer statistics. Update version to 2.0. + - Handle more kind or query types. Thanks to julien Rouhaud for + the patch. + - Fix pgbouncer log parser to handle message: FATAL: the database + system is shutting down + - Fix whitespace placed in between the E and the quote character. + Thanks to clijunky for the report. + - Fix a major issue introduced with support to pgbouncer that + prevent parsing of compressed PostgreSQL log files. Thanks to + Levente Birta for the report. +- remove the unused rpmlintrc + +------------------------------------------------------------------- +Sun Sep 13 11:40:04 UTC 2015 - lars@linux-schulserver.de + +- update to 7.1: + + This new release fixes some issues and adds a new report: + ++ Distribution of sessions per application + + It also adds Json operators to SQL Beautifier. + + this release also adds some more useful reports and features, + please check the changes file in + /usr/share/doc/packages/pgbadger/ChangeLog for details +- remove perl vendorarch directory if empty +- also package pgbadger_tools in doc directory +- add rpmlintrc to get rid of the license warning + +------------------------------------------------------------------- +Tue Oct 14 18:13:21 UTC 2014 - darin@darins.net + +- update to 6.2 + + This is a maintenance release to fix a regression in SQL traffic graphs and + fix some other minor issues. + + The release also add a new option -D or --dns-resolv to map client ip addresses + to FQDN without having log_hostname enabled on the postgresql's configuration + + Do not display queries in Slowest individual, Time consuming and + Normalized slowest queries reports when there is no duration in + log file. Display NO DATASET instead. + + Fix min/max queries in SQL traffic that was based on duration instead + of query count. + + Fix wrong unit to Synced files in Checkpoints files report. Thanks + to Levente Birta for the report. + + Enable allow_loose_quotes in Text::CSV_XS call to fix CSV parsing + error when fields have quote inside an unquoted field. Thanks to + Josh Berkus for the report. + +- Add -D | --dns-resolv command line option to replace ip addresses + by their DNS name. Be warned that this can slow down pgBagder a lot. + Thanks to Jiri Hlinka for the feature request. + +------------------------------------------------------------------- +Wed Mar 12 20:11:06 UTC 2014 - lars@linux-schulserver.de + +- update to 5.0: + + This new major release adds some new features like incremental + mode and SQL queries times histogram. There is also a hourly + graphic representation of the count and average duration of top + normalized queries. + + there are many more changes, please refer to + /usr/share/doc/packages/pgbadger/ChangeLog + for details + +------------------------------------------------------------------- +Mon May 6 09:51:04 UTC 2013 - lars@linux-schulserver.de + +- update to 3.3: + * adds four more useful reports about queries that generate locks + and temporary files + * new report about restartpoint on slaves and several + * adds escaping of HTML code inside queries + * adds Min/Max reports with Average duration in all queries reports + * many bug fixes + +------------------------------------------------------------------- +Sat Mar 23 17:44:15 UTC 2013 - lars@linux-schulserver.de + +- update to 3.1: + !! UPGRADE: if you are running pgbadger by cron take care if you + !! were using one of the following option: --enable-log_min_duration + !! and --enable-log_duration, they have been removed and pgbadger + !! will refuse to start + + This new major release adds parallel log processing by using as + many cores as wanted to parse log files, the performances gain is + directly related to the number of cores specified. + There's also new reports about autovacuum/autoanalyze informations + and many bugs have been fixed. + + Please read the full Changelog at: + /usr/share/doc/packages/pgbadger/ChangeLog +- do not use perl_gen_filelist macro on old distributions: + breaks build +- removed duplicated perl(Text::CSV_XS) build requires line + +------------------------------------------------------------------- +Wed Feb 13 13:22:57 UTC 2013 - darin@darins.net + +- update to 2.3 + * Clarify misleading statement about log_duration: log_duration may be + turned on depending on desired information. Only log_statement must + not be on. Thanks to Matt Romaine for the patch. + * Fix --dbname and --dbuser not working with csvlog format. Thanks to + Luke Cyca for the report. + * Fix issue in SQL formatting that prevent left back indentation when + major keywords were found. Thanks to Kevin Brannen for the report. + * Display 3 decimals in time report so that ms can be seen. Thanks to + Adam Schroder for the request. + * Force the parser to not insert a new line after the SET keyword when + the query begin with it. This is to preserve the single line with + queries like SET client_encoding TO "utf8"; + * Add better SQL formatting of update queries by adding a new line + after the SET keyword. Thanks to pilat66 for the report. + * Update copyright and documentation. + * See ChangeLog + +- added missing perl dependency for cvs logs + +------------------------------------------------------------------- +Sun Jan 6 03:50:45 UTC 2013 - lars@linux-schulserver.de + +- initial version 2.2-1 + diff --git a/PgBadger.spec b/PgBadger.spec new file mode 100644 index 0000000..79c5dda --- /dev/null +++ b/PgBadger.spec @@ -0,0 +1,121 @@ +# +# spec file for package pgbadger +# +# Copyright (c) 2013-2015 Lars Vogdt +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +%if 0%{?is_opensuse} +%bcond_without jsonxs +%else +%bcond_with jsonxs +%endif + +Name: PgBadger +Version: 12.2 +Release: 0 +License: MIT +Summary: A fast PostgreSQL log analyzer +Url: https://pgbadger.darold.net/ +Group: System/Monitoring +Source0: https://github.com/darold/pgbadger/archive/refs/tags/v%{version}.tar.gz#/pgbadger-%{version}.tar.gz +Source1: pgbadger-cron +BuildRequires: cron +BuildRequires: perl +BuildRequires: perl(Getopt::Long) +BuildRequires: perl(IO::File) +BuildRequires: perl(Pod::Markdown) +BuildRequires: perl(Benchmark) +BuildRequires: perl(File::Basename) +BuildRequires: perl(Time::Local) +BuildRequires: perl(Text::CSV_XS) +%if %{with jsonxs} +BuildRequires: perl(JSON::XS) +%endif +BuildRequires: sed +Requires: perl(Getopt::Long) +Requires: perl(IO::File) +Requires: perl(Benchmark) +Requires: perl(File::Basename) +Requires: perl(Storable) +Requires: perl(File::Spec) +Requires: perl(File::Temp) +Requires: perl(IO::Handle) +Requires: perl(IO::Pipe) +Requires: perl(FileHandle) +Requires: perl(Socket) +Requires: perl(Encode) +Requires: perl(Text::Wrap) +Requires: perl(Time::Local) +Requires: perl = %{perl_version} +Recommends: cron +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + +%description +pgBadger is a PostgreSQL log analyzer build for speed with fully detailed +reports from your PostgreSQL log file. It's a single and small Perl script that +aims to replace and outperform the old php script pgFouine. + +By the way, we would like to thank Guillaume Smet for all the work he has done +on this really nice tool. We've been using it a long time, it was a really +great tool! + +pgBadger is written in pure Perl language. It uses a javascript library to draw +graphs so that you don't need additional Perl modules or any other package to +install. Furthermore, this library gives us more features such as zooming. + +pgBadger is able to autodetect your log file format (syslog, stderr or csvlog). +It is designed to parse huge log files as well as gzip compressed file. + +%prep +%setup -n pgbadger-%version +sed -i "s|/usr/bin/env perl|%{_bindir}/perl|g" pgbadger tools/pgbadger_tools +chmod -x tools/pgbadger_tools + +%build +perl Makefile.PL +make %{?_smp_mflags} + +%if %{with jsonxs} +%check +make test +%endif + +%install +%perl_make_install +%perl_process_packlist +rmdir %{buildroot}%{perl_vendorarch} || : +install -Dm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.d/%{name} +%if 0%{?suse_version} >= 01130 +%perl_gen_filelist +%endif + +%if 0%{?suse_version} >= 01130 +%files -f %{name}.files +%defattr(-, root, root, -) +%doc ChangeLog README* tools +%license LICENSE +%else +%files +%defattr(-, root, root, -) +%doc ChangeLog README* LICENSE tools +%{_bindir}/pgbadger +%dir %{perl_vendorarch}/auto/pgBadger +%{perl_vendorarch}/auto/pgBadger/.packlist +%{_mandir}/man1/pgbadger.1* +/var/adm/perl-modules/pgbadger +%endif +%config(noreplace) %{_sysconfdir}/cron.d/%{name} + +%changelog diff --git a/pgbadger-12.2.tar.gz b/pgbadger-12.2.tar.gz new file mode 100644 index 0000000..98a94d4 --- /dev/null +++ b/pgbadger-12.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86677cb11d0fbcd80ed984c253318cf4b5f2e9ae11211c4b40606cf4536fb4b3 +size 3044596 diff --git a/pgbadger-cron b/pgbadger-cron new file mode 100644 index 0000000..de827a5 --- /dev/null +++ b/pgbadger-cron @@ -0,0 +1,22 @@ + +# The following example will auto-generate an incremental report from a +# postgresql log file, which is rotated on a daily base, every day at 04:00. +# +# You need the following settings in a standard postgresql-server installation +# in /var/lib/pgsql/data/postgresql.conf for this: +# log_filename = 'postgresql-%Y-%m-%d.log' +# log_rotation_age = 1d +# log_rotation_size = 0 +# +# The output will be placed below /srv/www/htdocs/pgbadger/ +# +# See https://github.com/darold/pgbadger/ for more details +# +#-0 4 * * * /usr/bin/pgbadger -I -q /var/lib/pgsql/data/pg_log/postgresql-$(date "+%Y-%m-%d" -d "yesterday").log -O /srv/www/htdocs/pgbadger/ + + +# +# The following example will generate a report every week using incremental behavior +# +#-0 4 * * 1 /usr/bin/pgbadger -q `find /var/lib/pgsql/data/ -mtime -7 -name "postgresql.log*"` -o /srv/www/htdocs/pgbadger/reports/pg_errors-`date +\%F`.html -l /srv/www/htdocs/pgbadger/reports/pgbadger_incremental_file.dat +